The PCM16 sample rate (Hz) of the chunks this engine will play
(e.g. 24000 for Gemini Live, the negotiated agent_output_audio_format rate for
ElevenLabs).
true while scheduled audio is audibly playing (playhead ahead of the context clock).
Flushes and releases the underlying audio context.
OPTIONAL: creates an IRealtimeAudioMeter tapping this engine's output — the
AGENT-audio side of the call UI's audio-reactive visuals. Drivers feed it to
BaseRealtimeClient's audio-activity surface. Optional so test fakes (and minimal
implementations) stay valid; callers use playback.CreateMeter?.() ?? null.
Schedules a raw PCM16 mono chunk back-to-back after any already-queued audio.
Stops + clears every scheduled source (barge-in / interruption).
Web Audio playout scheduler for raw PCM16 model audio at a driver-supplied sample rate.
Chunks are wrapped in
AudioBuffers and scheduled back-to-back against a playhead clock: each chunk starts atmax(playheadTime, currentTime)and advances the playhead by its duration, producing gapless playout regardless of network jitter. IsPlaying is computed directly from that clock — the playhead being ahead ofcurrentTime(with live sources) means audio is audibly coming out of the speaker. On interruption, Flush stops every scheduled source and rewinds the playhead.Generalized from the Gemini driver's original 24 kHz-fixed engine: the sample rate is now a constructor parameter so providers that negotiate their output format at session start (e.g. ElevenLabs'
agent_output_audio_format) can construct the playout engine with the negotiated rate.