Turn any PDF into an interactive audio experience.
Real-time text syncing, professional AI narration, and native mobile design.
Dictator AI is a modern web application that bridges the gap between reading and listening. It analyzes PDF documents, segments them into natural paragraphs, and uses OpenAI's advanced TTS (Text-to-Speech) models to narrate them with human-like quality.
Unlike standard screen readers, Dictator AI provides spatial context—highlighting the exact text block being read on the original PDF layout in real-time.
- Neural Voice Engine: Powered by OpenAI's
tts-1&tts-1-hd. - Smart Selection: Automatically chooses
gpt-4o-mini-ttsfor speed or HD models for quality. - Live Controls: Adjust Speed (0.5x - 3.0x) and Voice (Alloy, Echo, Shimmer...) instantly.
- Responsive Design: A buttery-smooth layout that adapts from desktop split-views to a modern mobile bottom-sheet interface.
- Touch Optimized: Large tap targets, swipeable interactions, and
100dvh(Dynamic Viewport Height) for a native app feel. - Background Play: Continue listening even when your screen is locked.
- Paragraph Segmentation: Smart backend logic groups sentences into natural reading blocks.
- Precision Highlighting: Real-time visual feedback shows you exactly where you are on the page.
- Interactive Layer: Click any paragraph on the PDF to jump the audio instantly to that spot.
- Framework: React 19 + Vite
- Language: TypeScript
- Styling: SCSS (BEM Architecture) + Radix UI Themes
- PDF Engine:
react-pdf - State: Custom Hooks
- Server: Flask (Python 3.11+)
- PDF Processing:
PyMuPDF(fitz) - AI Integration: OpenAI Python SDK
- Production Server: Gunicorn
- Node.js 20+
- Python 3.11+
- OpenAI API Key
-
Clone the repository
git clone https://github.com/yourusername/dictator-ai.git cd dictator-ai -
Backend Setup
cd backend python3 -m venv venv source venv/bin/activate pip install -r requirements.txt # Run the Flask Server export FLASK_APP=app.py flask run --port 5001
-
Frontend Setup
cd frontend npm install npm run devVisit
http://localhost:5173.
The application is containerized with a highly optimized Multi-Stage Build.
-
Build the Image
docker build -t dictator-ai . -
Run the Container
docker run -p 8080:5001 -e OPENAI_API_KEY=your_key_here dictator-ai
Note: You can also skip the env var if you prefer to enter the key in the UI Settings.
-
Access Go to
http://localhost:8080.
To access the application from your iPhone, iPad, or Android device on the same WiFi network:
- Open a terminal in the project root.
- Run the helper script:
./scripts/start-mobile.sh
- The script will build the Docker container and print a URL (e.g.,
http://192.168.1.5:5001). - Enter that URL in your mobile browser.
Note: Ensure your device and computer are on the same WiFi network.
The project follows a strict SCSS BEM methodology for clean, maintainable styles.
frontend/src/styles/main.scss: Entry point.frontend/src/styles/abstracts/_variables.scss: Design tokens (Colors, Spacing).frontend/src/styles/abstracts/_mixins.scss: Responsive helpers.
Example:
.mobile-layout {
&__bottom-sheet {
@include mobile {
height: 250px;
}
}
}MIT License. Created by Jeffrey Fernandez.
