Creates a new AudioClip instance with the specified URL.
The URL of the audio resource to load. This can be a path to an audio file or a MediaStream URL.
ReadonlyurlThe URL of the audio resource to load. This can be a path to an audio file or a MediaStream URL.
The underlying HTMLAudioElement, or undefined if not yet created.
Use this to connect the element to the Web Audio API via createMediaElementSource().
The HTMLAudioElement if the clip has been loaded or played, otherwise undefined.
Current playback position in seconds.
Whether the clip is currently playing.
true if the clip is actively playing audio.
Whether the clip should loop when reaching the end.
Normalized playback progress from 0 to 1.
The current playback position as a value between 0 and 1, or 0 if the duration is unknown.
Playback volume from 0 (silent) to 1 (full).
The total duration of the audio clip in seconds. Loads the audio metadata if not already available.
A promise that resolves with the duration in seconds.
Pauses playback at the current position. Call play to resume.
Seeks to a normalized position (0–1) in the clip.
A value between 0 (start) and 1 (end).
Stops playback and resets the position to the beginning.
Represents an audio clip that can be loaded and played independently. The AudioClip class encapsulates the URL of the audio resource and provides methods for playback control (play, pause, stop) and querying duration.