fix: prefer premium/enhanced voices over compact in Apple TTS#1117
Merged
tisfeng merged 5 commits intotisfeng:devfrom Mar 20, 2026
Merged
Conversation
Previously, voiceIdentifier(for:) always returned the compact (lowest quality) voice first, ignoring any Enhanced or Premium voices the user may have downloaded via System Settings. Now collects all matching voices for the locale and picks the highest quality one: premium (2) > enhanced (1) > others including compact (0). The two-pass loop is also simplified into a single pass. Fixes tisfeng#1116
Owner
|
Thanks your PR, we will review it later |
Contributor
There was a problem hiding this comment.
Pull request overview
Updates Apple TTS voice selection to prefer higher-quality system voices for a given language/locale.
Changes:
- Collects all voices matching the target locale and assigns a quality-based priority.
- Selects the highest-priority voice (premium > enhanced > others) instead of preferring compact voices.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Owner
Update Apple speech voice selection to rank premium, enhanced, then compact voices so playback falls back to compact instead of Eloquence or novelty voices. Add unit tests for the voice priority rules and register the new test file in the project.
Reflow the content-type mismatch conditions and the response data binding in stream result updates without changing behavior.
Owner
|
I have fixed this issue in 1ba6f8a Currently, the voice selection strategy is: premium > enhanced > compact, using compact as a fallback. |
Owner
|
Please review, if no problem, i will merge it |
Contributor
Author
|
Thanks for the update. I reviewed the latest changes and they look good to me. The |
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.

Summary
Fixes #1116
voiceIdentifier(for:)previously returned the compact (lowest quality) voice immediately, ignoring any Enhanced or Premium voices the user may have downloaded via System Settings.Changes
premium(2) >enhanced(1) > others includingcompact(0)Before / After
Before: always returns compact voice first, ignores downloaded Enhanced/Premium voices.
After: prefers
premium→enhanced→compact/others. The hardcoded fallback"com.apple.voice.compact.en-US.Samantha"is intentionally kept — compact is always pre-installed and serves as a safe last resort when no voice is found for the locale.Test plan