isStopped
isStopped(id: string): boolean;
Check if a sound is currently stopped. Returns true if the sound has been stopped via stop or has never been started, false otherwise.
Example
await soundManager.loadSounds([{ id: 'helicopter', url: 'helicopter.mp3' }]);
console.log(soundManager.isStopped('helicopter')); // true (not yet started)
soundManager.play('helicopter', { loop: true });
console.log(soundManager.isStopped('helicopter')); // false
soundManager.stop('helicopter');
console.log(soundManager.isStopped('helicopter')); // true
Sound State
stopped
isPlaying: falseisPaused: falseisStopped: trueTry it: Use the buttons to change the helicopter sound's state. Watch the status update in real time —
isPlaying, isPaused, and isStopped are mutually exclusive.