ReadonlyIstrue while scheduled audio is audibly playing (playhead ahead of the context clock).
Flushes and releases the underlying audio context.
OptionalConnectOPTIONAL: plays a media element's audio through this engine's output, so the agent meter
(CreateMeter) and the recording stream (GetOutputStream) carry it as they
carry PCM: an avatar's voice is in its video. Once per element for each engine; later calls
for the same element do nothing. An element shown in an earlier call works again in the
next. Optional so test fakes stay valid; callers use playback.ConnectMediaElement?.(element).
OptionalCreateOPTIONAL: 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).
OptionalGetOPTIONAL: the agent's output audio as a MediaStream, so a host can mix the agent voice
into a recording (issue #5153). Mirrors what WebRTC drivers get from the peer connection.
Optional so test fakes and environments without MediaStreamAudioDestinationNode stay
valid; callers use playback.GetOutputStream?.() ?? null.
The playback contract for a client-owned realtime audio plane: schedules raw PCM16 chunks for gapless playout and reports whether audio is AUDIBLY playing. Production is RealtimePcmPlayback (Web Audio, playhead-clock scheduling); tests inject a fake with a controllable
IsPlaying.Shared by every websocket driver whose audio plane is client-owned (Gemini Live, ElevenLabs Agents) — WebRTC drivers (OpenAI) get playback from the peer connection instead and don't use this.