Interface AudioOut
access this type via: io.audio.AudioOut (provides, requires or uses)
This API supports basic audio output. AudioTrack objects submitted to play on an output instance must contain audio frames in a format that matches the AudioFormat with which an AudioOut object is instantiated (no format conversion is performed).
Functions
bool ready()
void stopAll()
Events
trackFinished An event of this type is emitted when a track finishes playing (due to its last frame being output).
Create a new audio output instance with a given format.
bool ready()
Check if the audio output device is ready for playback. This should be checked after instantiation. A device may initially take some time to become ready for use, so periodic polling of ready() may be required. Once the device becomes ready it will remain ready until destroyed.
Play the audio frames in an audio track. The audio frames must match the audio format with which this instance has been constructed (such as channel counts).
Stop an in-progress track, removing it from output.
void stopAll()
Stop all audio playback from this output instance.