MCPcopy Create free account
hub / github.com/anomalyco/opencode / loadSoundFile

Function loadSoundFile

packages/tui/src/audio.ts:23–36  ·  view source on GitHub ↗
(file: string)

Source from the content-addressed store, hash-verified

21}
22
23export function loadSoundFile(file: string) {
24 const current = getAudio()
25 if (!current) return Promise.resolve(null)
26 const cached = sounds.get(file)
27 if (cached) return cached
28 const task = readFile(file)
29 .then((bytes) => current.loadSound(bytes))
30 .catch((error) => {
31 console.debug("failed to load tui sound", { file, error })
32 return null
33 })
34 sounds.set(file, task)
35 return task
36}
37
38export function play(sound: AudioSound, options?: AudioPlayOptions) {
39 const current = getAudio()

Callers

nothing calls this directly

Calls 4

getAudioFunction · 0.85
readFileFunction · 0.85
getMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected