Stops a sound effect by pausing playback and resetting its position to the beginning.
Useful for immediately silencing sound effects or interrupting looped audio.
Note that this completely stops the audio - to temporarily pause, use audioSource.pause() directly.

const audioSource = this.assetManager.getAudio("audio/sfx/coin.ogg");
stopSfx(audioSource);
  • Parameters

    • audioSource: HTMLAudioElement

      The audio source to stop.

    Returns void