Transcribe Audio Files to Text with OpenAI Whisper
OpenAI Whisper Reader transcribes audio files to text using the OpenAI Whisper API.
Why it matters
Convert audio files into accurate text transcriptions using OpenAI's Whisper API, enabling users to extract spoken content from audio recordings for indexing, analysis, or documentation purposes.
Outcomes
What it gets done
Load audio files from local file paths in various formats like MP3
Connect to OpenAI Whisper API with authentication credentials
Transcribe audio content to text using the Whisper-1 model
Return transcribed documents in LlamaIndex format for downstream processing
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/li-reader-readers-whisper | bash Overview
OpenAI Whisper Reader
OpenAI Whisper Reader is a LlamaIndex integration that transcribes audio files to text using the OpenAI Whisper API. It reads audio files from local paths and converts them into document objects, supporting both synchronous and asynchronous loading methods. Use this reader when you need to transcribe pre-recorded audio content, such as podcasts, meetings, or interviews. It's designed for batch processing of stored audio files rather than real-time streaming scenarios.
What it does
OpenAI Whisper Reader reads audio files and transcribes them to text using the OpenAI Whisper API. It converts spoken content from audio files into document objects that can be processed within your applications.
When to use - and when NOT to
Use Whisper Reader when you need to transcribe audio content, such as podcast episodes, recorded meetings, or audio interviews. It's designed for processing pre-recorded audio files that you have stored locally.
Do NOT use this reader if you need real-time streaming transcription of live audio - it processes pre-recorded files only. Avoid it if you require speaker diarization or advanced audio analysis features beyond basic transcription, as it focuses solely on converting speech to text.
Inputs and outputs
You provide the path to an audio file (such as MP3 format) and your OpenAI API key. The reader returns document objects containing the transcribed text. Both synchronous and asynchronous loading methods are supported.
Integrations
This reader uses the OpenAI Whisper API for transcription services.
Who it's for
This tool serves developers who need to transcribe audio content, data engineers creating archives of recorded content, and AI application builders working with audio files.
Installation and usage
Install via pip:
pip install llama-index-readers-whisper
Basic usage example:
from llama_index.readers.whisper import WhisperReader
# Initialize WhisperReader
reader = WhisperReader(
model="whisper-1",
api_key="your-api-key",
)
# Load data from audio file
documents = reader.load_data("path/to/your/audio/file.mp3")
# load data async
documents = await reader.aload_data("path/to/your/audio/file.mp3")
Source README
OpenAI Whisper Reader
Overview
Whisper Reader reads audio files and transcribes them to text using the OpenAI Whisper API.
Installation
You can install Whisper Reader via pip:
pip install llama-index-readers-whisper
Usage
from llama_index.readers.whisper import WhisperReader
### Initialize WhisperReader
reader = WhisperReader(
model="whisper-1",
api_key="your-api-key",
)
### Load data from audio file
documents = reader.load_data("path/to/your/audio/file.mp3")
### load data async
documents = await reader.aload_data("path/to/your/audio/file.mp3")
FAQ
Common questions
Discussion
Questions & comments · 0
Sign In Sign in to leave a comment.