Kokoro TTS voice selection with options #591
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🎤 Kokoro TTS Voice Selection Enhancement
This PR implements a comprehensive voice selection system for Agent Zero's Kokoro TTS integration, transforming the hardcoded voice configuration into a rich, user-friendly interface with modern styling.
✨ Key Features
🌍 54+ High-Quality Voices
🎛️ Advanced Voice Controls
🎨 Professional UI/UX
🔧 Technical Implementation
Backend Changes
Frontend Changes
🛡️ Error Handling & Validation
Voice Validation
Prevents invalid voices from reaching the API
if (not primary_voice or primary_voice in ["", "No blending"]):
primary_voice = "af_alloy" # Safe fallback
Only blend when valid secondary voice is selected
if (secondary_voice and secondary_voice not in ["", "No blending"]):
voice_string = f"{primary_voice},{secondary_voice}"
API Protection
🎯 User Experience Improvements
Before: Hardcoded voices, no user control
_voice = "am_puck,am_onyx" # Fixed configuration
_speed = 1.1 # No user adjustment
After: Rich voice selection with metadata
📱 Cross-Platform Compatibility
Browser Support
Theme Integration
🚀 Performance & Quality
Voice Quality Grades
Optimization
🔄 Backward Compatibility
🧪 Testing Considerations
This enhancement transforms Agent Zero's TTS system from a basic hardcoded configuration into a professional, user-friendly voice selection interface that rivals commercial TTS platforms while maintaining the system's open-source accessibility and customization capabilities.