Skip to main content

pause

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

Pause a sound by its ID. The playback position is preserved — call resume to continue from the same point, or stop to discard it.

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

Example

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

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

// Pause — position is saved
soundManager.pause('tokyo-train');

// Resume from the same position later
soundManager.resume('tokyo-train');
stopped
Tip: Pause preserves the playback position. Resume will continue from exactly where the sound left off.