mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-11-28 04:59:52 +01:00
1.5 KiB
1.5 KiB
SiliconFlow CosyVoice TTS Fixes
Issues Fixed
1. ❌ Invalid Voice Error
Problem: API returned "Invalid voice" error for 'diana' voice Solution: Removed voice parameter from API request - the API doesn't support separate voice selection yet
2. ✅ Updated API Request Format
Changes made:
- Removed
voiceparameter from payload - Set
stream: Trueto match your original example - Changed
speedto integer instead of float
3. ✅ Updated Configuration
Before:
siliconflow:
voice: diana # This caused the error
speed: 1.0 # Float value
After:
siliconflow:
# voice parameter removed - not supported by API
speed: 1 # Integer value
4. ✅ Fixed Test Script
- Improved config file path detection
- Removed voice parameter from fallback config
- Better error handling and output
Current Working Configuration
selected_module:
TTS: siliconflow
TTS:
siliconflow:
access_token: YOUR_TOKEN_HERE
model: FunAudioLLM/CosyVoice2-0.5B
response_format: mp3
speed: 1
gain: 0
output_dir: tmp/
API Request Format (Now Working)
payload = {
"input": text,
"response_format": "mp3",
"stream": True,
"speed": 1,
"gain": 0,
"model": "FunAudioLLM/CosyVoice2-0.5B"
}
# No voice parameter - handled by the model
Test the Fix
Run the test script again:
python test_siliconflow_tts.py
The "Invalid voice" error should now be resolved!