Transform web content and text into engaging AI-generated podcasts with natural-sounding conversations between two speakers.
- Uses OpenAI GPT-4 for script generation
- Requires OpenAI API key
- Fast and reliable cloud-based AI
- Pay-per-use pricing model
- Uses Ollama with local AI models
- No API keys required for script generation
- Completely private and offline
- Free to use after setup
- 🌐 Website Scraping: Extract content from any URL using Firecrawl
- 📋 Text Input: Paste any text content directly
- 🎭 Multiple Styles: Choose from Conversational, Interview, Debate, or Educational formats
- ⏱️ Flexible Duration: Generate podcasts from 5 to 20 minutes
- 🎵 AI Audio Generation: Convert scripts to natural-sounding speech using Kokoro TTS
- 📥 Export Options: Download both scripts (JSON) and audio files (WAV)
- 📚 Source Management: Store multiple sources and generate podcasts from any of them
- Python 3.11 or 3.12
- uv package manager
For Regular Version (app.py):
- OpenAI API key (required)
- Firecrawl API key (optional, for web scraping)
For Open Source Version (app_oss.py):
- Ollama installed and running
- A local AI model (e.g.,
gpt-oss:20b)
- Navigate to the project:
cd ai-podcast-generation- Install dependencies using uv:
uv sync- Set up your environment variables:
cp .env.example .env- Add your API keys to
.env(for regular version):
OPENAI_API_KEY=your_openai_api_key_here
FIRECRAWL_API_KEY=your_firecrawl_api_key_here # Optional
Regular Version (OpenAI):
uv run streamlit run app.pyOpen Source Version (Ollama):
# First, ensure Ollama is running with your model
ollama serve
ollama pull gpt-oss:20b # or your preferred model
# Then run the OSS app
uv run streamlit run app_oss.pyBoth apps will open in your default browser at http://localhost:8501
Navigate to the "📁 Add Sources" tab:
Option A: Scrape Website
- Select the "🌐 Website" tab
- Enter a URL (e.g., https://example.com/article)
- Click "Add Website"
- Wait for the content to be scraped
- Requires FIRECRAWL_API_KEY in .env
Option B: Paste Text
- Select the "📋 Text" tab
- Enter a source name
- Paste your content
- Click "Add Text"
Your sources will appear in the sidebar with:
- Source name/title
- Type (Website or Text)
- Word count
- Delete button (🗑️) to remove
- Navigate to the "🎙️ Studio" tab
- Select a source from the dropdown
- Choose your podcast style:
- Conversational: Natural, friendly discussion
- Interview: Q&A format
- Debate: Different perspectives
- Educational: Explanatory with clarifying questions
- Choose duration (5, 10, 15, or 20 minutes)
- Click "🎙️ Generate Podcast"
- Wait for script and audio generation
- Download the results!
ai-podcast-generation/
├── app.py # Main Streamlit application
├── src/
│ ├── podcast/
│ │ ├── script_generator.py # Podcast script generation
│ │ └── text_to_speech.py # Audio generation with TTS
│ └── web_scraping/
│ └── web_scraper.py # Web content extraction
├── outputs/ # Generated audio files
├── pyproject.toml # Project dependencies (uv)
├── .env.example # Environment variables template
└── README.md # This file
- Streamlit: Web interface
- OpenAI GPT-4: Script generation via CrewAI
- Kokoro TTS: Natural text-to-speech synthesis
- Firecrawl: Web content extraction
- uv: Fast Python package management
The app generates:
-
Podcast Script (JSON format):
- Structured dialogue between Speaker 1 and Speaker 2
- Metadata including source, duration, and line count
-
Audio Files (WAV format):
- Individual segments for each speaker turn
- Complete combined podcast with natural pauses
- High-quality 24kHz audio
- Style: Conversational, Interview, Debate, Educational
- Duration: 5, 10, 15, or 20 minutes
- Configured in the Studio tab
Modify in src/podcast/text_to_speech.py:
- Speaker voices (default:
af_heartandam_liam) - Sample rate (default: 24000 Hz)
- Pause duration between segments (default: 0.2s)
If you see "Web scraping will not be available":
- Add
FIRECRAWL_API_KEYto your.envfile - Get a key from https://www.firecrawl.dev
- Restart the app
If you see "TTS not available":
uv pip install kokoro>=0.9.4- Check your API key is correctly set in
.env - Ensure you have sufficient API credits
- Verify your API key has access to GPT-4 models
Make sure all dependencies are installed:
uv sync1. Add Source (URL or Text)
↓
2. Content is stored in session
↓
3. Select source in Studio
↓
4. Generate script (GPT-4)
↓
5. Generate audio (Kokoro TTS)
↓
6. Download script & audio
This project is part of the AI Engineering Hub.
- Inspired by NotebookLM's podcast generation feature
- Uses Kokoro TTS for natural-sounding speech synthesis
- Powered by OpenAI's language models
- Web scraping by Firecrawl
Contributions are welcome! Feel free to open issues or submit pull requests.
Built with ❤️ using Streamlit and AI