[6:14] (extern: com.aussom.aussomscript.AAudio) extends: object
The 'Audio' class provides audio playback support. It supports both URL-based playback through the HTMLAudioElement and buffer-based playback through the Web Audio API.
Audio (string Src = null)
Creates an Audio object. An optional URL can be provided to set the audio source immediately.
Src is an optional string with the audio URL.A new Audio object._init (string Src = null)
setSrc (string Src)
Sets the audio source URL.
Src is a string with the URL.this objectgetSrc ()
Gets the current audio source URL.
A string with the URL, or an empty string if not set.play ()
Starts or resumes playback.
this objectpause ()
Pauses playback.
this objectstop ()
Stops playback and resets position to the beginning.
this objectgetDuration ()
Gets the total duration of the audio in seconds.
A double with the duration, or 0 if unknown.getCurrentTime ()
Gets the current playback position in seconds.
A double with the current time.setCurrentTime (double Time)
Seeks to the given position in seconds.
Time is a double with the playback position in seconds.this objectgetVolume ()
Gets the current playback volume.
A double between 0.0 (silent) and 1.0 (full volume).setVolume (double Volume)
Sets the playback volume.
Volume is a double between 0.0 (silent) and 1.0 (full volume).this objectisMuted ()
Returns whether playback is muted.
A bool, true if muted.setMuted (bool Muted)
Sets the muted state.
Muted is a bool.this objectisLoop ()
Returns whether the audio will loop when it reaches the end.
A bool, true if looping is enabled.setLoop (bool Loop)
Sets whether the audio loops.
Loop is a bool.this objectisEnded ()
Returns whether playback has ended.
A bool, true if the audio has finished playing.isPaused ()
Returns whether playback is currently paused.
A bool, true if paused.canPlayType (string Type)
Tests browser support for an audio MIME type.
Type is a string such as "audio/mpeg" or "audio/ogg".A string: "probably", "maybe", or "" (unsupported).addListener (string Event, callback Handler, object PassedArg = null)
Registers an event listener on the audio element. Common event names include "play", "pause", "ended", "error", and "timeupdate".
Event is a string with the event name.Handler is a callback invoked as Handler(eventName, passedArg).PassedArg is an optional value forwarded to the handler.this objectplayBuffer (object Buf, callback OnEnded = null, callback OnError = null)
Plays audio from an Aussom buffer using the Web Audio API. The buffer must contain valid encoded audio data (MP3, OGG, WAV, etc.).
Buf is a buffer with the encoded audio bytes.OnEnded is an optional callback invoked when playback finishes.OnError is an optional callback invoked with an error string on failure.this object