Resolves with the server's Begin event once the handshake completes. A
single attempt is bounded by connectTimeout (default 1000ms); transient
failures (timeout, network drop, unexpected close) are retried up to
maxConnectionRetries times (default 2), waiting connectionRetryDelay
(default 500ms) between attempts. Permanent failures (auth, insufficient
funds, malformed config) are not retried.
Unlike previously, a failed connection now rejects this promise rather
than only invoking the error listener — necessary for the caller (and
the retry loop) to observe the failure.
In single-channel mode, audio is forwarded directly to the WebSocket and
options is ignored.
In dual-channel mode (when channels is configured), options.channel is
REQUIRED and must match one of the declared channel names. Per-channel PCM is
fed into that channel's VAD, accumulated into a per-channel ring buffer, and
a scheduled flush (channelAttribution.flushIntervalMs, default 50ms) mixes
the buffers into mono before sending to the WebSocket.
Parameters
audio: ArrayBufferLike
Optionaloptions: SendAudioOptions
Returns void
stream
stream(): WritableStream<ArrayBufferLike>
Returns a WritableStream that pumps PCM chunks into sendAudio. Single-channel
only — in dual-channel mode use sendAudio(pcm, { channel }) directly, since
WritableStream has no place to carry a channel tag.
Open the streaming session.
Resolves with the server's
Beginevent once the handshake completes. A single attempt is bounded byconnectTimeout(default 1000ms); transient failures (timeout, network drop, unexpected close) are retried up tomaxConnectionRetriestimes (default 2), waitingconnectionRetryDelay(default 500ms) between attempts. Permanent failures (auth, insufficient funds, malformed config) are not retried.Unlike previously, a failed connection now rejects this promise rather than only invoking the
errorlistener — necessary for the caller (and the retry loop) to observe the failure.