The media time (ms) of the audio heard now: the context's time, less the output latency the browser reports
(outputLatency and baseLatency, where it has them), placed in the chunk playing then. null while nothing plays,
between chunks, or while the chunk playing carries no media time (untimed audio with no timed audio before it).
true while scheduled audio is audibly playing (playhead ahead of the context clock).
Flushes and releases the underlying audio context.
Takes a media element's audio into the master gain, beside the PCM sources: the speakers, the meter and the recording tap then carry it. The audio arrives as the element's stream from the page's MediaElementAudioRouter, which connects the element to Web Audio once per page (a browser allows that once per element, ever), so the next call that shows the same element takes its voice too. Once per element for this engine. When the router can't route the element, it logs why; a failure here is logged too, never thrown: the call goes on without that element's voice.
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.
The chunk.
OptionalmediaTimeMs: numberWhere the chunk starts on the stream's media timeline (ms), when the driver knows it: a playback
that is also an IPlaybackClock then reads out the media time of the audio heard. A chunk without one continues
the chunk before it.
Stops + clears every scheduled source (barge-in / interruption).
The agent's output audio as a MediaStream, or null when unsupported. Hosts mix this
into a recording: WebRTC drivers get the agent voice from the peer connection, PCM
drivers (which play through Web Audio) must expose it from here. The stream lives on
this engine's own (e.g. 24 kHz) context, so consumers wrap it in a source node on THEIR
context rather than reusing this one.
Web Audio playout scheduler for Gemini's 24 kHz PCM16 model audio.
A thin specialization of the shared RealtimePcmPlayback (playhead-clock scheduling, gapless playout, honest
IsPlaying) fixed at Gemini Live's 24 kHz output rate. Kept as a named export for back-compat with existing consumers.