- Created PIPER_STATUS.md explaining current state and manual setup - Documented why automatic download doesn't work - Provided clear step-by-step setup instructions - Listed alternative (Kokoro TTS) for users who prefer zero-setup - Added troubleshooting for common errors Piper TTS is fully functional but requires one-time manual voice model download.
4.4 KiB
Piper TTS Integration Status
Current State: ✅ Integrated with Manual Setup Required
Piper TTS has been successfully integrated into the application as an alternative to Kokoro TTS. The integration is complete and functional, but requires manual voice model download before use.
What Works
✅ Backend Integration
- PiperTTSService with pitch control (-12 to +12 semitones)
- UnifiedTTSService managing both engines
- API endpoints for engine selection
- Voice preview support for Piper voices
✅ Frontend Integration
- Engine selector UI (Kokoro vs Piper buttons)
- Dynamic voice loading per engine
- Visual feedback for active engine
✅ Documentation
- Comprehensive setup guides
- API documentation
- Troubleshooting instructions
What Requires Manual Setup
⚠️ Voice Models Must Be Downloaded Manually
Piper voice models cannot be auto-downloaded due to:
- HuggingFace repository structure complexity
- SSL certificate verification issues in some environments
- Large file sizes (10-50MB per voice)
This is a one-time setup step.
How to Use Piper TTS
Step 1: Install Piper Binary
cd backend
./install_piper.sh
Verify: piper --version
Step 2: Download Voice Models
-
Download these files for each voice you want:
en_US-lessac-medium.onnx(model file)en_US-lessac-medium.onnx.json(config file)
-
Place in:
backend/piper_models/
Recommended starter voices:
en_US-lessac-medium(Male, American)en_US-amy-medium(Female, American)en_GB-alan-medium(Male, British)
Step 3: Test Installation
cd backend
python test_piper_direct.py
Step 4: Use in Application
- Start backend:
uvicorn main:app --reload - Start frontend:
npm run dev - In Voice Assignment screen, click "Piper TTS" button
- Select Piper voices from dropdown
- Generate audiobook with pitch control!
Why Manual Download?
We attempted automatic download but encountered:
- SSL Certificate Issues: Python's urllib has certificate verification problems
- URL Structure: HuggingFace's repository structure is complex
- Reliability: Manual download is more reliable across different environments
Trade-off: One-time manual setup vs. unreliable automatic downloads
Alternative: Use Kokoro TTS
If Piper setup is too complex, Kokoro TTS works perfectly out of the box with:
- ✅ No manual setup required
- ✅ 54 voices across 9 languages
- ✅ High quality synthesis
- ❌ No pitch control
Simply keep the default "Kokoro TTS" engine selected.
Error Messages You Might See
"Voice model not found"
Cause: Voice model files not downloaded
Solution: Download .onnx and .onnx.json files and place in backend/piper_models/
See: backend/PIPER_SETUP.md for detailed instructions
"Piper not found"
Cause: Piper binary not installed
Solution: Run ./install_piper.sh or install manually
"Preview failed"
Cause: Voice model missing or Piper not working
Solution:
- Check voice models are downloaded
- Test with
python test_piper_direct.py - Check backend logs for detailed errors
Future Improvements
Potential enhancements for easier setup:
- Bundled Voice Models: Include 1-2 default voices in repository
- Download Script: Create a helper script to download popular voices
- UI Download: Add "Download Voice" button in frontend
- Alternative Hosting: Host models on a simpler CDN
- Docker Image: Pre-package models in Docker image
Documentation
- Setup Guide:
backend/PIPER_SETUP.md - Integration Details:
PIPER_TTS_INTEGRATION.md - Usage Guide:
backend/PIPER_TTS_GUIDE.md - Backend README:
backend/README.md
Support
If you encounter issues:
- Check
backend/PIPER_SETUP.mdfor setup instructions - Run
python test_piper_direct.pyto diagnose problems - Check backend logs for detailed error messages
- Fall back to Kokoro TTS if needed
Summary
Piper TTS is fully integrated and functional, but requires a one-time manual setup to download voice models. This is a reasonable trade-off for gaining pitch control capabilities. Users who prefer zero-setup can continue using Kokoro TTS.
Recommendation: Document the manual setup clearly in user-facing documentation and consider it a "power user" feature.