Skip to main content

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.

ParameterTypeDescription
idstringID of the sound to mute

See also: unmute, toggleMute, muteAllSounds


Example

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

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

// Mute (still playing, just silent)
soundHub.mute('tokyo-train');

// Restore original volume
soundHub.unmute('tokyo-train');
Tip: Muting does not stop the sound — it continues playing silently so unmuting resumes at the correct position.