Create a new dictation service.
The parameters to use for the service.
ProtectedfetchProtectedfetchProtectedfetchOpen a dictation that audio is pushed into.
The push-style counterpart of transcribeLive(), for sources that
deliver audio through a callback rather than a stream. The request starts
immediately; call session.write(chunk) from the callback, then
await session.result() for the transcript once the speaker stops. See
DictationLiveSession.
Options for this dictation request. Raw PCM requires
sample_rate and channels.
Client-side options: the total request deadline, which must cover the dictation.
The open session.
Transcribe dictated audio, uploading it as it is produced.
Starts the request immediately and uploads chunks as they arrive, so authorization, the upload and every speech segment but the last resolve while the speaker is still talking. What is left to wait for once they stop is the final segment, and the LLM pass if one was asked for. Audio that is already complete — bytes, a Blob, a local path — is accepted as well and sent as a single chunk over the same connection.
A producer must keep producing: an upload that goes silent for long
enough is aborted server-side, so stop by ending the stream rather than
pausing it. The service caps a request at 120 s of audio. For sources
that deliver audio through a callback rather than a stream, see
openLive().
Audio still being produced (an async iterable, Node
streams included; a sync iterable; a web ReadableStream) or audio held
whole (a local file path, a data URL, raw bytes, a Blob). Raw PCM also
requires sample_rate and channels on the config.
Options for this dictation request.
Client-side options: the total request deadline and an optional abort signal.
A promise that resolves to the finished transcript, whose
final_text carries the LLM rewrite when one was asked for.
Open the connection to the dictation API ahead of time.
A request that opens its connection on demand pays the full DNS + TCP +
TLS handshake before the first audio byte can leave — one network round
trip that, for a distant client, is a noticeable share of a short
dictation. Call warm() as soon as you know audio is coming — when the
user reaches for the record button, say — and the next request reuses the
already-open connection. It is idempotent and cheap, so calling it again
to refresh the connection is fine; call it shortly before the request,
since the pooled connection idles out after a few seconds.
A promise that resolves to true once the connection is open
(any HTTP response — even a non-200 — means the socket is established),
or false if the connection could not be opened.
The dictation service: a short spoken note in, a transcript out.
Tuned for dictation — someone speaks a note and wants it back as text, optionally cleaned up or reformatted. The audio is uploaded while it is still being spoken, from a callback with
openLive()or from a stream withtranscribeLive(), so the upload and every speech segment but the last are done by the time the speaker stops. Audio already held whole — bytes, a Blob, a local path — goes totranscribeLive()too and travels the same connection as a single chunk: there is one request shape here.Unlike
client.transcripts, which submits a job to the async API and polls for completion, there is no job id, no status to poll and no URL ingestion. Beyond the transcript it can run a follow-up LLM pass: setllm_instructionon the config and readfinal_textoff the result.Requests go to the dictation API (
dictation.assemblyai.com), which thedictationBaseUrlclient option overrides.