Use this file to discover all available pages before exploring further.
In this guide, we’ll show you how to perform automatic language detection separately from the transcription process. For the transcription, the file then gets then routed to either our Universal-3 Pro or Universal-2 model class, depending on the supported language.This workflow is designed to be cost-effective, slicing the first 60 seconds of audio and running it through Universal-2 ALD, which detects 99 languages, at a cost of $0.002 per transcript for this language detection workflow (not including the total transcription cost).
Define a Transcriber. Note that here we don’t pass in a global TranscriptionConfig, but later apply different ones during the transcribe() call.
transcriber = aai.Transcriber()
Define two helper functions:
detect_language() performs language detection on the first 60 seconds of the audio and returns the language code.
transcribe_file() performs the transcription. For this, the identified language is applied and either Universal-3 Pro or Universal-2 is used depending on the supported language.
Test the code with different audio files. For each file, we apply both helper functions sequentially to first identify the language and then transcribe the file.