useSoundtrack
Loops a system sound while enabled.
import { useSoundtrack } from 'filedom/sound';
useSoundtrack('Submarine', { playing, volume: 0.25 });
The sound loops while playing is true and stops when playing turns false or the component unmounts. Muting pauses the loop and unmuting resumes it.
Parameters
useSoundtrack(
sound: SystemSound | null,
opts: { playing: boolean; volume?: number; backend?: SoundBackend; }
)
sound: built-in macOS sound name, or null for silence.
opts: playing is required; volume and backend are optional.
Returns
Nothing (void).