Generate a static web page that plays questionnaire items with high-quality neural TTS with keyboard controls and smarter audio caching.
- ↑ Studio-grade synthesis via edge-tts (free Microsoft neural voices).
↔️ Buttons and keyboard shortcuts- ← / → – previous / next item
- space / R – replay current audio.
- 🏃♂️ One-shot build: creates
tts_site/with MP3s +index.html, then serves onhttp://localhost:8000. - ⚡ Caching: skips synthesis if the MP3 already exists unless
--forceis given. - 📊 Item numbering display (1-based indexing)
- 🎵 Audio completion tracking (prevents skipping during playback)
- 📋 Multi-questionnaire support with selection page
- 🎯 Individual questionnaire directories with dedicated audio files
# Install uv if you haven't already
curl -LsSf https://astral.sh/uv/install.sh | sh
git clone https://github.com/yuckyman/questionnaire-tts.git
cd questionnaire-tts
uv sync
uv run pai_tts.py --build-all# Build all questionnaires and serve selection page
uv run pai_tts.py --build-all
# Build single questionnaire
uv run pai_tts.py items.txt
# Just serve existing site
uv run pai_tts.py --serve-only
# Rebuild audio with different voice
uv run pai_tts.py --build-all --force --voice en-US-GuyNeuralA pre-built Windows executable is included: pai_tts_v3.exe
- What is it?
- A standalone version of the TTS builder for Windows users. No Python or dependencies required.
- How to use:
- Place your questionnaire
.txtfiles in thequestionnaires/folder (same as with the Python version). - Double-click
pai_tts_v3.exeor run it from the command line:or for a single questionnaire:pai_tts_v3.exe --build-allpai_tts_v3.exe items.txt - The output will be in the
tts_site/folder, just like with the Python script.
- Place your questionnaire
- Limitations:
- Only tested on Windows 10/11.
- Some advanced features (like custom voices or serving via HTTP) may be limited compared to the Python version.
- If you encounter issues, try running from the command prompt to see error messages.
You can use any Microsoft Edge neural voice. Some popular ones:
en-US-JennyNeural(default)en-US-GuyNeuralen-US-AriaNeuralen-GB-RyanNeuralen-GB-SoniaNeural
Place your questionnaire files in the questionnaires/ directory:
questionnaires/
├── PAI.txt
├── SASSI.txt
└── PSI-4.txt
Each .txt file should contain one question per line. The script will automatically:
- Create individual directories for each questionnaire
- Generate audio files for each question
- Build a selection page with questionnaire cards
- Show estimated duration and question count