Skip to main content

resetSound

resetSound(id: string, options?: SoundResetOptions): void;

Reset a specific sound by its ID. Optionally, provide SoundResetOptions to customize which aspects to reset.

By default ({}), all properties are reset to defaults. Use keep* properties to selectively preserve certain values:

// Reset everything on a single sound
soundManager.resetSound('bells-melody');

// Keep the volume, reset everything else
soundManager.resetSound('bells-melody', { keepVolumes: true });

Example

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

soundManager.play('bells-melody', { loop: true, volume: 0.3, pan: -0.8 });

// Reset only volume and pan back to defaults
soundManager.resetSound('bells-melody');
Volume0.7
Pan0
Playback Rate1
Try it: Adjust volume, pan, and rate while playing. Click resetSound(id) to reset all properties to defaults. Use resetSound(id, { keepVolumes: true }) to selectively keep certain settings.