๐๏ธ Podsite - AI Podcast Generation โ
Transform web content and text into engaging AI-generated podcasts with natural-sounding conversations between two speakers.
๐ Two Versions Available โ
๐ฑ Regular Version (app.py) โ
- Uses OpenAI GPT-4 for script generation
- Requires OpenAI API key
- Fast and reliable cloud-based AI
- Pay-per-use pricing model
๐ Open Source Version (app_oss.py) โ
- Uses Ollama with local AI models
- No API keys required for script generation
- Completely private and offline
- Free to use after setup
โจ Features โ
- ๐ 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
๐ Quick Start โ
Prerequisites โ
- 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)
Installation โ
- 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 # OptionalRunning the Apps โ
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
๐ Usage โ
Step 1: Add Sources โ
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
Step 2: Generate Podcast โ
- 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!
๐๏ธ Project Structure โ
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๐ ๏ธ Technology Stack โ
- 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
๐ Example Output โ
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
๐ง Configuration โ
Podcast Settings โ
- Style: Conversational, Interview, Debate, Educational
- Duration: 5, 10, 15, or 20 minutes
- Configured in the Studio tab
Audio Settings โ
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)
๐ Troubleshooting โ
Web Scraping Not Available โ
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
TTS Not Available โ
If you see "TTS not available":
uv pip install kokoro>=0.9.4OpenAI API Errors โ
- 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
Import Errors โ
Make sure all dependencies are installed:
uv sync๐ก Workflow โ
1. 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๐ License โ
This project is part of the AI Engineering Hub.
๐ Acknowledgments โ
- 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
๐ค Contributing โ
Built with โค๏ธ using Streamlit and AI