Skip to content

Fix unclear error when realtime demo has no voice presets#404

Open
aqeelabpro wants to merge 1 commit into
microsoft:mainfrom
aqeelabpro:fix-missing-voice-presets
Open

Fix unclear error when realtime demo has no voice presets#404
aqeelabpro wants to merge 1 commit into
microsoft:mainfrom
aqeelabpro:fix-missing-voice-presets

Conversation

@aqeelabpro

Copy link
Copy Markdown

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

Copilot AI review requested due to automatic review settings June 8, 2026 14:52

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ValueError when voice_presets is empty before selecting a default voice.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread demo/realtime_model_inference_from_file.py Outdated
@aqeelabpro aqeelabpro force-pushed the fix-missing-voice-presets branch from a9fd6a4 to 93fe962 Compare June 8, 2026 14:57

@rickthomasjr rickthomasjr left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants