Convert audio recordings into structured, searchable text. Built for turning sermon series, podcast episodes, and lecture recordings into publishable books and digital content.
This REST API takes audio files from Google Drive and returns:
- Complete transcriptions with speaker identification
- Summaries and key topics
- Structured JSON output ready for editing and publishing
Primary use case: Transform a series of recordings (sermons, lectures, podcasts) into material for books, study guides, or searchable archives.
- Python 3.12+
- Google Gemini API key (get one free)
- FFmpeg (
brew install ffmpegon macOS)
git clone https://github.com/yourusername/audio-transcription-api.git
cd audio-transcription-api
# Create virtual environment
python3.12 -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Set your API key
export GEMINI_KEY=your_api_key_here
# Run the service
python main.pyVisit http://localhost:8000/docs to see the API documentation.
- Upload audio to Google Drive (make the folder public)
- Start transcription:
curl -X POST http://localhost:8000/transcribe \
-H "Content-Type: application/json" \
-d '{
"google_drive_link": "https://drive.google.com/drive/folders/YOUR_FOLDER_ID",
"gemini_api_key": "YOUR_API_KEY"
}'Returns: {"job_id": "abc-123", "status": "queued"}
- Check progress:
curl http://localhost:8000/transcribe/abc-123- Get results when complete:
curl http://localhost:8000/transcribe/abc-123/resultsTransform audio series into publishable books!
Perfect for:
- Sermon series → Devotional books
- Podcast episodes → Published anthology
- Conference talks → Conference proceedings
- Lecture series → Educational textbooks
- Workshop recordings → Training manuals
- Interview series → Curated collections
curl -X POST http://localhost:8000/transcribe \
-H "Content-Type: application/json" \
-d '{
"google_drive_link": "https://drive.google.com/drive/folders/YOUR_FOLDER_ID",
"gemini_api_key": "YOUR_API_KEY",
"to_book": true,
"book_title": "Your Book Title Here",
"author_name": "Author Name"
}'What happens:
- Transcribes all audio files
- Cleans the text - removes filler words (um, uh, you know), fixes grammar
- Organizes into chapters - one chapter per recording, in order
- Generates a foreword based on the series content
- Extracts key points and references from each chapter
- Returns book-ready structure you can edit and publish
Important: The content is NOT summarized. The complete message is preserved and cleaned for readability.
{
"job_id": "abc-123",
"status": "completed",
"results": [
{
"file_path": "sermon-01.mp3",
"success": true,
"result": {
"transcription": "Complete text of the recording...",
"language": "en",
"speakers": ["Speaker 1", "Speaker 2"],
"summary": "Brief summary of the content",
"key_topics": ["faith", "prayer", "community"],
"processing_time": 45.2
}
}
]
}| Endpoint | Method | Description |
|---|---|---|
/ |
GET | Health check |
/transcribe |
POST | Start transcription job |
/transcribe/{job_id} |
GET | Check job status |
/transcribe/{job_id}/results |
GET | Get transcription results |
/usage |
GET | API usage statistics |
/docs |
GET | Interactive API documentation |
MP3, WAV, M4A, AAC, OGG, FLAC, OPUS
Maximum file size: 200MB per file
# Required
GEMINI_KEY=your_gemini_api_key
# Optional
PORT=8000
NODE_ENV=production
MAX_AUDIO_SIZE_MB=200
CLEANUP_TEMP_FILES=trueOption 1: Include in each request (recommended for multi-user deployments)
{
"google_drive_link": "...",
"gemini_api_key": "your_key"
}Option 2: Set as environment variable (simpler for single-user)
export GEMINI_KEY=your_keydocker build -t audio-transcription .
docker run -p 8000:8000 -e GEMINI_KEY=your_key audio-transcription- Fork this repository
- Connect to your deployment platform
- Set environment variable:
GEMINI_KEY=your_api_key - Deploy
See QUICK_DEPLOY.md for detailed platform-specific instructions.
- Batch transcription from Google Drive folders
- Speaker identification
- Content summaries and topic extraction
- Usage tracking and cost monitoring
- Multi-user support (each user brings their own API key)
Phase 1: Enhanced Output (Current)
- Basic transcription with speaker detection
- Summaries and key topics
- Export to common formats (DOCX, PDF, Markdown)
- Chapter/section detection for long recordings
Phase 2: Book Publishing Pipeline
- Series organization (group related recordings)
- Automated chapter generation
- Editorial workflow (mark sections for editing)
- Export templates for book formatting
- Table of contents generation
Phase 3: Advanced Features
- Custom vocabulary support (proper nouns, technical terms)
- Timestamp linking to original audio
- Web interface for non-technical users
- Webhook notifications
- Additional storage backends (S3, Dropbox)
Archive sermon series into searchable text. Create study guides and devotional books from years of teachings.
Convert lecture series into textbooks or course materials. Make audio content accessible to students with hearing impairments.
Generate show notes, blog posts, and books from podcast episodes. Build searchable archives of your content.
Document meetings, create training manuals from recorded sessions, archive company knowledge.
We welcome contributions! Areas where help is needed:
- Export formats (DOCX, PDF, Markdown)
- Additional storage backends (S3, Azure, Dropbox)
- Performance optimizations
- Test coverage
- Tutorial videos
- Integration examples
- Translation to other languages
- Try with different audio types
- Report bugs and edge cases
- Suggest improvements
To contribute:
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Make your changes with clear commit messages
- Submit a pull request
Issues tagged good-first-issue are great starting points.
Built with:
- FastAPI - Modern Python web framework
- Google Gemini 2.5 Flash - Transcription and language processing
- FFmpeg - Audio file handling
- gdown - Google Drive integration (no OAuth required)
The service processes audio files one at a time, uploads them to Google's Gemini API for transcription, and returns structured results via REST endpoints.
"GEMINI_KEY is required"
- Provide
gemini_api_keyin request body OR setGEMINI_KEYenvironment variable
"No audio files found"
- Ensure Google Drive folder is publicly accessible
- Verify folder contains supported audio formats
- Check folder URL is correct
"Out of memory" errors
- Increase MAX_CHUNK_SIZE_MB in settings
- Use smaller audio files
- Deploy with more RAM (upgrade hosting tier)
Python 3.13 compatibility issues
- Use Python 3.12:
python3.12 -m venv venv - The
audioopmodule was removed in Python 3.13
Google Gemini API:
- Free tier: 1,500 requests/day
- Paid tier: $0.075 per 1M input tokens (~$10-20/month for moderate use)
Hosting:
- Railway/Render: ~$5/month
- Google Cloud Run: Pay per use (typically $1-10/month)
- Self-hosted: Free
MIT License - see LICENSE file for details.
- Documentation: Quick Start Guide | Deployment Guide
- Issues: GitHub Issues
- Questions: Open a Discussion
Built for archiving knowledge and making audio content accessible.