Code Switching
Transcribe audio containing multiple languages with code switching detection. This feature enables accurate transcription of conversations where speakers naturally switch between languages during conversations.
Built-in code switching
Universal-3-Pro (Recommended)
Universal-3-Pro has built-in code switching capabilities across English, Spanish, Portuguese, French, German, and Italian. Set language_detection to True to automatically detect the spoken language, and use a prompt to preserve the original language mix in your transcript.
Here is an example of how Universal-3-Pro handles spoken audio in English and French.
Example output:
Python
JavaScript
Language support
Universal-3-Pro supports English, Spanish, Portuguese, French, German, and Italian. To access all 99 languages, use "speech_models": ["universal-3-pro", "universal-2"] as shown in the code example. Read more here.
Universal-2
Supports code switching between 99 languages, with best performing code switching languages being en, es, de.
To enable code switching for Universal-2 only, set speech_models to universal-2, set language_detection as True, and set code_switching as True as shown in the example below.
Example API Response
When enabling code switching with automatic language detection, the two detected language codes with the highest confidence and their confidence will be included in the transcript JSON.
99 languages coverage
To get the best performing transcription while extending code switching across all 99 supported languages, specify both “Universal-3-Pro” and “Universal-2” using the speech_models parameter, allowing our system to automatically route your audio based on language support.
Model routing behavior: The system attempts to use the models in priority order falling back to the next model when needed. For example, with ["universal-3-pro", "universal-2"], the system will try to use universal-3-pro for languages it supports (English, Spanish, Portuguese, French, German, and Italian), and automatically fall back to Universal-2 for all other languages. This ensures you get the best performing transcription where available while maintaining the widest language coverage.
Other supported languages
While additional languages are supported for code switching, optimal results typically require the non-English language to be dominant in the audio. For English-dominant content with other languages, standard single-language transcription may be more appropriate.
We highly recommend testing sample code switching files with your specific audio to assess performance and evaluate outputs. We also recommend using an LLM to correct and fine-tune our model’s outputs.
Manually Setting Language Codes
To manually set the language codes, you can use the language_codes parameter. A max of two language codes can be set and one code must be "en". For example, if your file contains both English and Spanish, it would be "language_codes": ["en", "es"].
Code Switching Confidence Threshold
The code_switching_confidence_threshold parameter controls how certain the model must be before identifying a language switch. Set this to a value between 0 and 1 to filter out low-confidence language detections and reduce false positives. This will only use identified languages above this threshold. The model identifies a maximum of two languages per audio file.
Code Switching Confidence Threshold
By default, the code_switching_confidence_threshold parameter is set to
0.3. If you would like to disable this, make sure to set this parameter to
0.
Troubleshooting
If your audio contains primarily one language with only occasional words from another language, standard single-language transcription may be more appropriate than code-switching mode.
Related features
- Supported Languages - View all available language options
- Speaker Diarization - Identify different speakers in multi-speaker conversations
- Keyterms Prompting - Boost transcription accuracy