Readonlyonfires when a read found the queue short, with the seconds of silence it had to put in
Readonlysample'worker' while the core runs off the main thread, 'inline' otherwise
stops the worker and drops what is queued; the host cannot be used afterwards
sends a channel message; applied at atFrame, or at the start of the next block to be rendered when omitted
OptionalatFrame: numbersends many channel messages in one go, each at its own frame: one post to the worker instead of one per message
Asks the runner for whatever the queue is missing; called by every read and safe to call
from a timer. A worker keeps queueSeconds rendered ahead of the playhead, hiding its
latency from the game; the inline fallback renders just in time instead, since a queue on the
thread that pays for it only moves the cost, and a message then lands on exactly its frame.
an endless source: fills count frames, with silence where the core was late, and always returns count
silences the core and discards everything rendered ahead of the playhead
moves the playhead; a different frame resets the core, the same frame leaves it playing
Starts a piece: silences the core, drops what was rendered ahead, and queues list before any
further audio is asked for. A host starts rendering ahead as soon as it exists, so messages sent
afterwards with events would reach the core after the audio they belong to was already made and
start late; this orders the reset, the messages and the rendering so they cannot.
OptionalatFrame: number
Runs a synthesis core on a worker and presents it as an endless
BlockSource, so aStreamChannelplays it like any stream while the render cost stays off the frame. Messages go to the core stamped with an output frame and are applied at that frame; blocks come back transferred, not copied, and wait in a short queue thatreaddrains. When the queue runs dry the missing frames are silence, the playhead moves on, and the underrun is counted and reported (onUnderrun,onAudioUnderrun), so timing never drifts. Where no worker exists, or one dies, the same runner runs on the main thread instead: slower for the frame, identical in sound.Example