A web application for collecting voice recordings to fine-tune Whisper speech recognition models. Extract random phrases from PDFs or pasted text, record yourself speaking them, and automatically save WAV files with a CSV manifest.
- Dual Input: Upload PDF files or paste text directly
- Smart Phrase Extraction: Automatically extracts random 3-5 word phrases
- Session-Based: Each recording session gets its own folder
- Auto-Save: Recordings are saved immediately after each phrase
- WAV Format: High-quality uncompressed audio for ML training
- CSV Manifest: Automatic mapping of phrases to audio files
- Keyboard Shortcuts: Space to record/stop, Enter for next phrase
- Progress Tracking: Visual progress bar and history panel
# Clone or navigate to the project
cd VoiceApp
# Install dependencies with uv
uv syncuv run uvicorn main:app --port 8000Or run directly:
uv run python main.py- Open http://localhost:8000 in your browser
- Enter a session name (e.g.,
my_voice_session) - Choose input source:
- Upload PDF: Drag & drop or click to select a PDF file
- Paste Text: Switch to the text tab and paste your content
- Set the number of phrases to extract (default: 50)
- Click "Extract Phrases" to begin
- For each phrase:
- Click Record (or press
Space) to start recording - Speak the phrase clearly
- Click Stop (or press
Space) to stop - Preview the recording if needed
- Click Next Phrase (or press
Enter) to save and continue - Use Re-record if you want to try again
- Click Record (or press
- Click Stop Session when finished (or complete all phrases)
Each session creates a folder in data/<session_name>/ containing:
data/my_voice_session/
├── 001.wav
├── 002.wav
├── 003.wav
├── ...
└── manifest.csv
The manifest.csv file contains:
phrase,audio_file
"the quick brown",001.wav
"fox jumps over",002.wav
"the lazy dog",003.wavVoiceApp/
├── app/
│ ├── __init__.py
│ ├── pdf_processor.py # PDF text extraction & phrase generation
│ └── session.py # Session management & file saving
├── static/
│ ├── index.html # Main UI
│ ├── css/
│ │ └── styles.css # Styling
│ └── js/
│ ├── app.js # Main application logic
│ ├── recorder.js # Audio recording module
│ └── wav-encoder.js # WAV format encoder
├── data/ # Recording sessions (created at runtime)
├── main.py # FastAPI server
├── pyproject.toml # Project dependencies
└── README.md
| Method | Endpoint | Description |
|---|---|---|
| GET | / |
Serve the web UI |
| GET | /api/health |
Health check |
| POST | /api/start-session |
Start a new recording session |
| POST | /api/upload-pdf |
Upload PDF and extract phrases |
| POST | /api/parse-text |
Parse pasted text and extract phrases |
| POST | /api/save-recording |
Save a WAV recording |
| POST | /api/end-session |
End session and save manifest |
| GET | /api/session-info |
Get current session info |
| Key | Action |
|---|---|
Space |
Start/Stop recording |
Enter |
Save and go to next phrase |
- Backend: FastAPI, pdfplumber, uvicorn
- Frontend: Vanilla JavaScript, Web Audio API, MediaRecorder API
- Package Manager: uv
- Python 3.11+
- Modern browser with microphone support (Chrome, Firefox, Edge)
- Use a quiet environment
- Speak clearly and at a natural pace
- Keep consistent distance from the microphone
- Use a good quality microphone if available
- Record in a room with minimal echo
MIT