Use this file to discover all available pages before exploring further.
This page explains the different ways you can export and format your transcript data, including SRT/VTT caption files, paragraphs and sentences, and word-level timestamps.
You can export completed transcripts in SRT or VTT format, which can be used for subtitles and closed captions in videos.You can also customize the maximum number of characters per caption by specifying the chars_per_caption parameter.
import assemblyai as aaiaai.settings.api_key = "<YOUR_API_KEY>"# audio_file = "./local_file.mp3"audio_file = "https://assembly.ai/wildfires.mp3"config = aai.TranscriptionConfig( speech_models=["universal-3-pro", "universal-2"], language_detection=True)transcript = aai.Transcriber(config=config).transcribe(audio_file)if transcript.status == "error": raise RuntimeError(f"Transcription failed: {transcript.error}")srt = transcript.export_subtitles_srt( # Optional: Customize the maximum number of characters per caption chars_per_caption=32 )with open(f"transcript_{transcript.id}.srt", "w") as srt_file: srt_file.write(srt)# vtt = transcript.export_subtitles_vtt()# with open(f"transcript_{transcript_id}.vtt", "w") as vtt_file:# vtt_file.write(vtt)
You can retrieve transcripts that are automatically segmented into paragraphs. The text of the transcript is broken down by paragraphs, along with additional metadata.
You can retrieve transcripts that are automatically segmented into sentences, for a more reader-friendly experience. The text of the transcript is broken down by sentences, along with additional metadata.