feat: audio quality improvements — anti-robot TTS pipeline

- Added VOICE_QUALITY ratings for all engines (naturalness/calmness)
- Azure SSML now uses mstts:express-as style="calm" for human-like delivery
- Added --list-engines with quality rankings
- Added --quality-check for A/B sample comparison
- Updated README with quality-first guidance
- Warns against Piper for production (robotic-ish)
- Recommends Azure AriaNeural or ElevenLabs Rachel
This commit is contained in:
wmj2024
2026-06-28 02:09:10 +08:00
parent cb22804a1f
commit cd35b46393
2 changed files with 120 additions and 26 deletions
+36 -11
View File
@@ -39,25 +39,50 @@ audio_ready: true
## Audio Pipeline
### Free TTS Options (Female, Calm, Human-like)
### ⚠️ Quality First — No Robot Voices
| Service | Voice | Quality | Free Tier | Setup |
|---------|-------|---------|-----------|-------|
| **Azure Speech** | `en-US-AriaNeural` | Excellent | 500K chars/mo | Azure account |
| **Piper TTS** | `amy` (local) | Good | Unlimited | Download + run locally |
| **Google Cloud** | `en-US-Neural2-F` | Good | 1M chars/mo | GCP account |
| **ElevenLabs** | `Rachel` | Excellent | 10K chars/mo | API key |
FalahMobile learners expect warm, natural, human-like audio. We specifically avoid the "Stephen Hawking" robotic sound of old TTS systems.
### Quality Rankings (Naturalness / Calmness)
| Service | Voice | Naturalness | Free Tier | Setup |
|---------|-------|-------------|-----------|-------|
| **ElevenLabs** ★ | `Rachel` | 9.5/10 | 10K chars/mo | API key |
| **Azure Speech** ★ | `en-US-AriaNeural` | 9.0/10 | 500K chars/mo | Azure account |
| **Google Cloud** | `en-US-Neural2-F` | 8.0/10 | 1M chars/mo | GCP account |
| **Piper TTS** | `amy` | 6.5/10 | Unlimited | Local download |
> **Recommendation**: Use **Azure AriaNeural** or **ElevenLabs Rachel** for production. Piper is acceptable for testing but sounds noticeably synthetic.
### Generate Audio
```bash
# Using Azure (recommended free tier)
python scripts/generate-audio.py --course daily-fiqh-beginner --engine azure
# See all engines with quality ratings
python scripts/generate-audio.py --list-engines
# Using Piper (completely free, local)
python scripts/generate-audio.py --course daily-fiqh-beginner --engine piper
# Compare quality with a sample (generates test files)
python scripts/generate-audio.py --quality-check
# Using Azure (recommended — human-like, calm female)
python scripts/generate-audio.py --course daily-fiqh-beginner --engine azure --voice en-US-AriaNeural
# Using ElevenLabs (best quality, limited free tier)
export ELEVENLABS_API_KEY="your-key"
python scripts/generate-audio.py --course daily-fiqh-beginner --engine elevenlabs --voice Rachel
# Using Piper (free, local, acceptable for testing)
python scripts/generate-audio.py --course daily-fiqh-beginner --engine piper --voice amy
```
### SSML Settings for Natural Delivery
The script uses Azure's **calm expressive style** with gentle prosody:
- `rate="-5%"` — slightly slower than normal speech
- `pitch="-2%"` — slightly deeper, more grounded
- `mstts:express-as style="calm"` — warm, meditative tone
This is tuned for religious/reflective content. Not robotic. Not rushed. Human.
## Gitea Integration
Push content to your Gitea instance: