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

Function playSound

packages/app/src/utils/sound.ts:89–98  ·  view source on GitHub ↗
(src: string | undefined)

Source from the content-addressed store, hash-verified

87}
88
89export function playSound(src: string | undefined) {
90 if (typeof Audio === "undefined") return
91 if (!src) return
92 const audio = new Audio(src)
93 audio.play().catch(() => undefined)
94 return () => {
95 audio.pause()
96 audio.currentTime = 0
97 }
98}
99
100export function playSoundById(id: string | undefined) {
101 return soundSrc(id).then((src) => playSound(src))

Callers 1

playSoundByIdFunction · 0.70

Calls 1

playMethod · 0.80

Tested by

no test coverage detected