Language Translation - Sanas Developer Hub

Creating a translation processor

auto p = sdk->CreateAudioProcessor(
    AudioParams::WithLanguages("en-US", "es-ES", 16000), rc,
    onState, onTranscript);

Language code format

Language codes follow BCP-47 format: language-REGION, for example "en-US", "es-ES", "ar-SA". Pass "*" as the source language for automatic source-language detection.

Supported languages

The exact set available to your account is determined by Portal entitlements. Commonly available languages:

Language Code Language Code
Arabic (Saudi Arabia) ar-SA Italian it-IT
Arabic (UAE) ar-AE Japanese ja-JP
Czech cs-CZ Korean ko-KR
Danish da-DK Malay ms-MY
Dutch nl-NL Mandarin zh-CN
English (UK) en-GB Polish pl-PL
English (US) en-US Portuguese (Brazil) pt-BR
Finnish fi-FI Portuguese (Portugal) pt-PT
French fr-FR Romanian ro-RO
French (Canadian) fr-CA Russian ru-RU
German de-DE Spanish (Lat. Am.) es-419
Greek el-GR Spanish (Spain) es-ES
Hindi hi-IN Swedish sv-SE
Hungarian hu-HU Thai th-TH
Indonesian id-ID Turkish tr-TR

Auto source-language detection

AudioParams::WithLanguages("*", "fr-FR", 16000)

Conversation ID

A conversation ID ties a stream to a named session. The SDK auto-generates a UUID if you leave it empty. When calling UpdateLanguageConfig to switch languages on a live processor, use the same conversation ID that was set at creation time — do not generate a new one.

Changing languages on a live stream

You can switch the language pair on a kReady processor without closing the connection.

// conversationId = same value used when processor was created
LanguageConfig cfg("en-US", "fr-FR", conversationId);
UpdateLanguageResult r = processor->UpdateLanguageConfig(cfg);
// check: kSuccess / kProcessorNotReady / kInvalidParameters / kFailed