Class: Toybox.Audio.Output.StreamingAudioSource
- Inherits:
-
Toybox.Lang.Object
Overview
Subclass this and override onReadyForData to make a streaming audio source.
Instance Method Summary collapse
-
append(buffer as Lang.ByteArray) as Lang.Number
Append bytes to the audio stream.
-
end() as Void
Indicate that no more data will be added to the stream.
-
getBufferSize() as Lang.Number
Get the size of the internal buffer in bytes.
- initialize(options as { :format as Audio.AudioFormat, :bufferSize as Lang.Number })
-
onError(error as Output.Error) as Void
This function is called if there is an error while this source is playing.
-
onReadyForData(freeSpace as Lang.Number) as Void
This function is called when the data in the internal buffer gets low, or if the buffer is empty when the source is played.
Instance Method Details
append(buffer as Lang.ByteArray) as Lang.Number
Append bytes to the audio stream.
end() as Void
Indicate that no more data will be added to the stream.
getBufferSize() as Lang.Number
Get the size of the internal buffer in bytes.
initialize(options as { :format as Audio.AudioFormat, :bufferSize as Lang.Number })
onError(error as Output.Error) as Void
This function is called if there is an error while this source is playing.
onReadyForData(freeSpace as Lang.Number) as Void
This function is called when the data in the internal buffer gets low, or
if the buffer is empty when the source is played.