Audio¶
Import: import system.audio;
Read the audio guide for usage, limits, and current platform restrictions.
Audio¶
A web-style audio player. Constructors configure sources; load and play perform I/O.
constructor¶
Creates an empty player. Assign src before calling play.
constructor¶
Creates a streaming player for a path or HTTP URL without starting I/O.
constructor¶
Creates a streaming player for a path or URL with snapshotted buffering limits.
constructor¶
Snapshots encoded bytes; detection and decoding begin when loading starts.
constructor¶
Snapshots encoded bytes with a configurable decoded-data limit.
constructor¶
Creates a player from already decoded PCM without including encoded-format decoders.
load¶
Cancels prior loading and prepares the current source; returns an I/O or decoding error.
play¶
Loads if necessary and starts or resumes playback. Browser activation may be required.
pause¶
Pauses without changing position; repeating pause emits no duplicate event.
close¶
Cancels loading and releases output. Queued events remain available after closure.
poll_events¶
Drains ordered typed notifications, including after close.
src¶
Current string source; empty for PCM and encoded-byte constructors.
src¶
Replaces the source, cancelling prior playback and pending loads.
current_time¶
Current position in seconds.
current_time¶
Requests an absolute seek in seconds; invalid requests preserve the current position.
duration¶
Source duration in seconds, absent until metadata is loaded and for streams that do not declare one, such as streamed MP3.
volume¶
Linear gain from zero to one; mute does not change this value.
volume¶
Sets finite gain from zero to one, preserving the previous value on error.
muted¶
Whether this player is muted.
muted¶
Toggles mute without changing the stored volume.
loop¶
Whether natural completion restarts playback.
loop¶
Enables repetition of a seekable source.
paused¶
Whether playback is paused, including before the first play call.