Skip to main content

stop

stop(id: string, skipDispatchEvent?: boolean): void;

Stop a sound by its ID. Unlike pause, stop discards the playback position — calling play again will restart from the beginning.

ParameterTypeDescription
idstringID of the sound to stop
skipDispatchEventbooleanWhen true, suppresses the stop event

Example

await soundManager.loadSounds([{ id: 'tokyo-train', url: 'tokyo-train-melody.mp3' }]);

soundManager.play('tokyo-train', { loop: true });

// Stop and discard position
soundManager.stop('tokyo-train');

// Playing again restarts from 0
soundManager.play('tokyo-train');
stopped
Tip: After stopping, clicking Play restarts from the beginning. Use pause if you want to resume from the same position.