Speech

Realtime translation

Translate finalized realtime transcript segments into a selected target language.

Realtime translation combines Perigee-1-transcribe-realtime with Perigee-1-text. Speech is transcribed first, then coherent final segments are translated. Partial transcript drafts are not translated.

Enable translation

socket.send(JSON.stringify({
  type: "config",
  language: "hausa",
  sample_rate: 16000,
  translate: true,
  target_language: "Yoruba"
}));
FieldDescription
languageSource speech language. Use one of the 10 realtime speech languages.
translateSet to true.
target_languageOne of the 19 text languages and different from the source.
translation_domainOptional vocabulary context such as banking.
translation_window_msOptional final-segment coalescing window.

Routing is handled automatically from one session configuration.

Attach translations to transcripts

socket.addEventListener("message", ({ data }) => {
  const event = JSON.parse(data);
 
  if (event.type === "final") {
    appendTranscript(event.segment_id, event.text);
  }
 
  if (event.type === "translation") {
    attachTranslation(event.segment_ids, event.text);
  }
});

A translation event includes the segment_ids it covers. Use those IDs to attach translated text to the correct finalized source text.

If translation cannot complete, the service emits translation_failed for the affected final segments. The original transcript remains usable.

Event order

  1. Receive partial transcript drafts.
  2. Receive a stable final transcript with a segment_id.
  3. Receive translation for one or more final segment IDs.
  4. If translation fails, receive translation_failed; the source transcript remains valid.

The approximately 200 ms latency figure applies to realtime transcription, not to the complete transcription-and-translation flow. Translation follows coherent final segments and therefore arrives later.

Next steps

On this page