This stream's current model name (flips to 'turn-detector-v1-mini'
after a cloud→local fallback). The swap is also written back to the owning
detector, which shares this stream's mutable ThresholdOptions.
Drain the shared audio channel into the current transport.
The audio channel exposes a single ReadableStream (one underlying
transform.readable), so only one reader may hold its lock at a time.
When signal aborts (a transport being swapped out — e.g. cloud→local
fallback — fires it via detach()), we release the reader lock right
away: on a pending read() this rejects that read and frees the lock so
the swapped-in transport's _drainAudioChannel can re-acquire it.
Without this an orphaned drain would hold the lock forever and the next
getReader() would throw "ReadableStream is locked".
Optional signal: AbortSignalAccept a prediction from a transport. A stale response (request id
mismatch) is ignored; otherwise the in-flight future resolves with the
full TurnDetectionEvent and the request completes.
Optional backchannelOptional detectionOptional inference
Stream that owns the
turn-detector-v1→turn-detector-v1-mini(cloud → local) fallback FSM. On cloud transport failure (transport.run()raises, orpredictEndOfTurntimes out), the stream swaps the transport and rescales per-language thresholds in place on the sharedThresholdOptions, then writes the model swap back to the owning detector so its view stays consistent.