class Sound::Stream
- Sound::Stream
- SF::SoundStream
- SF::SoundSource
- Reference
- Object
Defined in:
sound.crConstructors
Instance Method Summary
-
#on_get_data : Slice(Int16) | Nil
Request a new chunk of audio samples from the stream source
- #on_seek(time_offset)
- #set_frequency(frequency : Float)
- #set_waveform(waveform : Waveform)
Constructor Detail
Instance Method Detail
def on_get_data : Slice(Int16) | Nil
#
Description copied from class SF::SoundStream
Request a new chunk of audio samples from the stream source
This function must be overridden by derived classes to provide the audio samples to play. It is called continuously by the streaming loop, in a separate thread. The source can choose to stop the streaming loop at any time, by returning false to the caller. If you return true (i.e. continue streaming) it is important that the returned array of samples is not empty; this would stop the stream due to an internal limitation.
- data - Chunk of data to fill
Returns: True to continue playback, false to stop