Plays a sound effect from the beginning, even if it's currently playing. Ideal for one-shot sound effects like explosions, impacts, or UI feedback.
While this function can play any audio, it's recommended to use the AudioPlayer component for background music or longer tracks.
The AudioPlayer component provides additional features like handling browser autoplay policies, fading, and advanced playback control.
Plays a sound effect from the beginning, even if it's currently playing. Ideal for one-shot sound effects like explosions, impacts, or UI feedback.
While this function can play any audio, it's recommended to use the AudioPlayer component for background music or longer tracks.
The AudioPlayer component provides additional features like handling browser autoplay policies, fading, and advanced playback control.
Example
Example
Example