You can use to transcribe audio files inside your LlamaIndex applications.
assemblyai
python package.
ASSEMBLYAI_API_KEY
. You can get a free AssemblyAI API key from the AssemblyAI dashboard.
AssemblyAIAudioTranscriptReader
. The AssemblyAIAudioTranscriptReader
needs at least the file_path
argument.file_path
argument with a URL or a local file path to an audio or video file.reader.load_data()
waits until the transcription is ready.reader.load_data()
method returns an array of documents, but by default, there’s only one document in the array with the full transcript. The transcribed text is available in the text
attribute:
metadata
contains the full transcript object with more meta information:
transcript_format
argument to load the transcript in different formats.
Depending on the format, load_data()
returns either one or more documents. These are the different TranscriptFormat
options:
TEXT
: One document with the transcription textSENTENCES
: Multiple documents, splits the transcription by each sentencePARAGRAPHS
: Multiple documents, splits the transcription by each paragraphSUBTITLES_SRT
: One document with the transcript exported in SRT subtitles formatSUBTITLES_VTT
: One document with the transcript exported in VTT subtitles formatconfig
argument to use different audio intelligence models.