mute
mute(id: string): void;
Mute a specific sound by its ID without stopping it. The sound continues playing silently. Call unmute to restore the original volume.
| Parameter | Type | Description |
|---|---|---|
id | string | ID of the sound to mute |
See also: unmute, toggleMute, muteAllSounds
Example
await soundManager.loadSounds([{ id: 'tokyo-train', url: 'tokyo-train-melody.mp3' }]);
soundManager.play('tokyo-train', { loop: true });
// Mute (still playing, just silent)
soundManager.mute('tokyo-train');
// Restore original volume
soundManager.unmute('tokyo-train');
Tip: Muting does not stop the sound — it continues playing silently so unmuting resumes at the correct position.