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.
| Parameter | Type | Description |
|---|---|---|
id | string | ID of the sound to pause |
skipDispatchEvent | boolean | When 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.