ReadonlyIsfalse when capture could not start (unsupported platform, no permission, no encoder).
Mixes the agent's audio in once its track arrives, so the recording carries both sides.
Milliseconds into the recording, derived from the samples captured so far on the 48 kHz sample clock (never wall clock), used to stamp per-turn cue offsets into the assembled file.
OptionalReplaceOPTIONAL: records the microphone stream's current track from now on, after its track was replaced (a device switch, or a lost device replaced by the default). A recorder bound to the old track would otherwise record silence. A recorder without it keeps its original binding.
Begins capture of the microphone, mixing in the agent's audio when it is already available.
remoteStream is usually null here: on WebRTC the agent's track commonly lands slightly
after the connection resolves, so the runtime also wires AttachRemoteStream.
Stops capture, flushes the encoder (its last packets become available to
TakeEncodedPackets), and resolves the total number of samples captured at 48 kHz. That
count may be less than packets × 960 when the encoder padded its last frame; the runtime
trims the final shard to it. Idempotent: a second call resolves the same count.
Returns the 20 ms Opus packets encoded since the previous call, in capture order, and forgets
them; an empty array when none are ready. Synchronous and cheap: it hands over what the
encoder already produced and never encodes on the caller's thread — the runtime calls it from
pagehide, where there is no time to wait for an encoder.
The recording capability a host may optionally provide.
The host captures the call (mic + agent mix) at 48 kHz and runs ONE continuous Opus encoder for the whole call: mono, 32 kbps, 20 ms frames (960 samples). The runtime pulls the encoded packets every few seconds, cuts them into indexed
MJOPUS1shards, keeps each one in a durable local store until the server acknowledges it, and sends a terminal request when the call ends. The host never builds a container (no WAV, no Ogg) and never base64-encodes anything: the server assembles the finalrecording.wavfrom the shards.Every method is best-effort by contract: a recorder that fails mid-session must degrade to "no recording" rather than failing the call, because audio capture is never worth dropping a live conversation over.