Skip to main content
Automatic language detection identifies the spoken language in audio so transcription can use the appropriate language. In Gladia, you can let detection consider all supported languages or provide a small candidate list. When the conversation can change languages, configure code switching as well and provide the languages you expect.
Provide a small list of likely languages when possible. It improves accuracy and reduces latency.

How to use language detection ?

Choose the language_config that matches your audio:
  • One known language: Set languages to that language code (for example ["en"]) and keep code_switching off.
  • Unknown language from a small set: Pass the candidate languages you expect. A short list is usually more accurate and faster than searching all supported languages.
  • Conversations that change languages: Enable code switching and provide a nonempty expected-language list.
  • Detection vs translation: Language detection selects the spoken language for transcription. Translating the transcript into another language is a separate translation feature.
You can either omit language_config.languages to search across all supported languages, or pass a constrained list:
The detected language is returned on each utterance and can vary over time if you also enable code switching.

Tips

  • Use supported languages to pick valid ISO 639-1 codes.
  • Check model selection for language detection availability by model. Live transcription uses Solaria-1.
  • Multiple languages or code switching can reduce partial transcript accuracy — keep the expected-language list focused, since fewer candidate languages make detection more reliable and partial transcripts more stable.
  • Combine with messages_config.receive_partial_transcripts in real time to get immediate feedback.
  • For mixed-language conversations, enable code switching.