Fix unclear error when realtime demo has no voice presets#404
Open
aqeelabpro wants to merge 1 commit into
Open
Fix unclear error when realtime demo has no voice presets#404aqeelabpro wants to merge 1 commit into
aqeelabpro wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds an explicit failure mode when no voice preset files are available, preventing an implicit IndexError and providing a clearer error for users.
Changes:
- Raise a
ValueErrorwhenvoice_presetsis empty before selecting a default voice.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
a9fd6a4 to
93fe962
Compare
rickthomasjr
approved these changes
Jun 14, 2026
rickthomasjr
left a comment
There was a problem hiding this comment.
Review: Approve — fix unclear error for missing voice presets
UX improvement: Replacing an unhelpful error with a clear, actionable message when the realtime demo has no voice presets configured. This prevents users from being stuck debugging.
Verdict: Approve. Good error message improvement.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
When no voice preset files are found, get_voice_path falls back to the first
entry in an empty voice preset map raises an unclear IndexError.
This change reports the missing preset condition directly.
Tested:
python -m py_compile demo/realtime_model_inference_from_file.py