Async translation with Node SDK
Translate audio asynchronously with the Soniox Node SDK
Soniox Node SDK supports asynchronous speech translation through
client.stt.translate.
It creates an async transcription job with translation enabled, then reshapes
the completed transcript into a structured translation result.
Use async translation when you want to translate uploaded files, public audio URLs, or previously uploaded files without maintaining a live connection.
This method is just a syntactic sugar on top of client.stt.transcribe.
Use transcribe if you need more low level control on the output.
Quickstart
For simple one-way translation, provide to and one audio source:
Translation modes
One-way translation
Use to to translate any detected source language to a target language.
If you know the source language, provide from. The SDK forwards it as a language hint for the underlying async transcription job.
Two-way translation
Use between for bidirectional translation between two languages. This is
useful for conversations where either language can appear in the audio.
Wait later
If you do not want to block until the job completes, omit wait and call
wait or
fetchTranslation
later.
Use with webhooks
Async translation jobs are regular async transcription jobs with translation enabled, so you can use the same webhooks flow.
In the webhook handler, fetch the transcript and reshape it with
translateFromTranscript.
Fetch transcript instead of translation
translate() also keeps access to the underlying transcript. This is useful
when you need both the original token stream and the reshaped translation.
Translation tokens do not carry timestamps, so TranscriptToken.start_ms,
TranscriptToken.end_ms, and matching segment timestamps can be undefined
for translation-only tokens.