An intelligent system that automatically converts your email newsletters into personalized audiobooks using AI text-to-speech technology. Never miss important content from your favorite newsletters - listen to them on the go!
Audio Digest Hub transforms your daily email newsletters into high-quality audiobooks by:
- Email Processing: Automatically fetches newsletters from your Gmail inbox
- Content Extraction: Intelligently extracts and cleans newsletter content
- AI Voice Synthesis: Converts text to natural-sounding speech using Kokoro TTS (formerly Coqui)
- Smart Organization: Creates structured audiobooks with chapters for each newsletter
- Web Player: Provides a modern web interface to listen to your audiobooks with progress tracking
- Framework: React 18 with TypeScript
- UI Components: shadcn/ui with Tailwind CSS
- State Management: TanStack Query for server state
- Authentication: Supabase Auth
- Audio Player: Custom player with chapter navigation and progress tracking
-
Database: PostgreSQL with real-time subscriptions
-
Storage: File storage for audiobook MP3s
-
Edge Functions: TypeScript serverless functions for API endpoints
-
Authentication: Row-level security and API key management
-
TTS Engine: Kokoro TTS (82M parameters) β a compact, fast, and high-quality open-source TTS model
-
Email Integration: Gmail API for newsletter fetching
-
Audio Processing: PyDub for MP3 conversion and chunking
-
Smart Scheduling: Automatic processing with duplicate detection
- Node.js (v18 or higher) - Install with nvm
- Python (3.8 or higher) with pip
- Gmail Account with API access enabled
- Supabase Account for backend services
-
Clone and install dependencies:
git clone <repository-url> cd audio-digest-hub npm install
-
Start the development server:
npm run dev
-
Build for production:
npm run build
-
Navigate to the audiobooks directory:
cd src/audiobooks -
Create a virtual environment:
python -m venv audiogeneratorenv source audiogeneratorenv/bin/activate # On Windows: audiogeneratorenv\Scripts\activate
-
Install Python dependencies:
pip install -r requirements.txt
-
Configure the system:
- Copy
config.ini.exampletoconfig.ini(if available) - Set up Gmail API credentials in
credentials.json - Configure Supabase API URL and service role key
- Optionally add a reference voice file for custom TTS voice
- Copy
-
Run the audio processor or Colab notebook:
-
Colab (recommended for GPU): Open
src/audiobooks/TTS_Generation_Colab.ipynbin Google Colab and run the notebook for a GPU-accelerated Kokoro TTS workflow. -
Local: Use the Python script (CPU/GPU) to process audio locally:
python generate_audiobook.py
The Python processor supports several command-line options:
# Process a specific date
python generate_audiobook.py --date 2024-01-15
# Process a date range
python generate_audiobook.py --start-date 2024-01-01 --end-date 2024-01-15
# Auto-detect and process since last upload (default behavior)
python generate_audiobook.py- React 18 - Modern React with hooks and concurrent features
- TypeScript - Type-safe JavaScript development
- Vite - Fast build tool and development server
- Tailwind CSS - Utility-first CSS framework
- shadcn/ui - High-quality React components
- Radix UI - Accessible component primitives
- TanStack Query - Powerful data synchronization
- React Router - Client-side routing
- Supabase - Backend-as-a-Service platform
- PostgreSQL - Robust relational database
- Deno - Secure TypeScript runtime for edge functions
- Row Level Security - Database-level authorization
- Kokoro TTS - Open-source, small-footprint TTS engine with high quality (24kHz native)
- PyTorch - Machine learning framework
- PyDub / soundfile - Audio manipulation and I/O utilities
- Gmail API - Email integration
This project migrated its TTS engine from Coqui (XTTS v2) to Kokoro TTS.
- Kokoro provides a smaller, faster, and actively maintained model (approx. 82M parameters).
- Kokoro's native sample rate is 24 kHz; the notebook and pipeline use this by default.
- For GPU-accelerated generation, use the
TTS_Generation_Colab.ipynbnotebook insrc/audiobooks.
audio-digest-hub/
βββ src/
β βββ components/ # Reusable React components
β βββ pages/ # Application pages (Dashboard, Player, Settings)
β βββ hooks/ # Custom React hooks
β βββ lib/ # Utility functions
β βββ integrations/ # Supabase client configuration
β βββ audiobooks/ # Python audio processing system
β βββ generate_audiobook.py # Main processing script
β βββ requirements.txt # Python dependencies
β βββ config.ini # Configuration file
βββ supabase/
β βββ functions/ # Edge functions (API endpoints)
β βββ migrations/ # Database schema migrations
β βββ config.toml # Supabase configuration
βββ public/ # Static assets
βββ package.json # Node.js dependencies and scripts
- Automatic Gmail integration with OAuth2
- Smart content extraction and cleaning
- Markdown link removal and text optimization
- Duplicate detection to prevent reprocessing
- High-quality AI voice synthesis
- Custom voice cloning support
- Automatic audio chunking for large content
- Chapter-based organization by newsletter source
- Responsive design for all devices
- Audio player with chapter navigation
- Progress tracking and resume functionality
- User authentication and personal libraries
- Scalable Supabase infrastructure
- Secure API key authentication
- Automatic file storage and management
- Real-time data synchronization
- API Key Authentication: Secure access to backend services
- Row Level Security: Database-level access control
- Local Processing: Email content processed locally on your machine
- Encrypted Storage: Secure file storage in Supabase
- OAuth2 Integration: Secure Gmail access without storing passwords
# Frontend tests
npm run lint
# Python tests
cd src/audiobooks
python -m pytestCreate a .env.local file for frontend configuration:
VITE_SUPABASE_URL=your_supabase_url
VITE_SUPABASE_ANON_KEY=your_supabase_anon_key
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
If you encounter any issues or have questions:
- Check the logs in
audiobook_generator.logfor Python processing issues - Verify your Gmail API credentials and Supabase configuration
- Ensure all dependencies are properly installed
- Check the browser console for frontend issues
- Kokoro TTS for providing a compact, fast, and high-quality open-source text-to-speech engine (recommended replacement for Coqui)
- Coqui TTS (historical) β originally used in this project
- Supabase for the powerful backend-as-a-service platform
- shadcn/ui for the beautiful component library
- Gmail API for reliable email integration