play-streaming-audio-clip ( audio-engine source generator buffer-count -- audio-clip/f )
Audio playback engine

Prev:<streaming-audio-clip> ( audio-engine source generator buffer-count -- audio-clip/f )
Next:Audio source protocol


Vocabulary
audio.engine

Inputs
audio-enginean audio-engine
sourcean object implementing the Audio source protocol
generatoran object implementing the Audio generator protocol
buffer-countan integer


Outputs
audio-clip/fan audio-clip or f


Word description
Constructs and immediately starts playing a streaming-audio-clip tied to source and playing audio generated by generator. buffer-count buffers will be allocated for the clip. The clip will automatically be disposed by the audio-engine when the generator stops supplying data and all the buffered data has played. The clip will in turn dispose its generator when it is disposed. If the engine has no available voices, no clip will be constructed, the generator will be disposed, and f will be returned.

Notes
Use play-clips with <static-audio-clip> and <streaming-audio-clip> to synchronize the playing of multiple clips.

Definition


: play-streaming-audio-clip
( audio-engine source generator buffer-count -- audio-clip/f )
<streaming-audio-clip> dup [ play-clip ] when* ;