Transcribe an audio file
Learn how to transcribe and analyze an audio file.
Step 1: Install the SDK
Step 2: Configure the SDK
In this step, you 'll create an SDK client and configure it to use your API key.
Browse to , and then click the text under Your API key to copy it.
Step 3: Submit audio for transcription
In this step, you'll submit the audio file for transcription and wait until it's completes. Transcribing an audio file takes somewhere between 15–30% of the audio duration.
Specify a URL to the audio you want to transcribe. The URL needs to be accessible from AssemblyAI's servers. For a list of supported formats, refer to the FAQ.Local audio files
If you already have an audio file on your computer, you can also specify a local path, for example
YouTube URLs are not supported. If you want to transcribe a YouTube video, you need to download the audio first.
To generate the transcript, pass the audio URL to
transcribe(). This may take a minute while we're processing the audio.
If the transcription failed, the
statusof the transcription will be set to
error. To see why it failed you can print the value of
Print the complete transcript.
Run the application and wait for it to finish.
You've successfully transcribed your first audio file. You can see all submitted transcription jobs in the .
Step 4: Enable additional AI models
In addition to the full transcript, you now have access to utterances from each speaker.
In this tutorial, you've learned how to generate a transcript for an audio file and how to extract speaker information by enabling the Speaker diarization model.
Want to learn more?