Exclude iOS joke voices from ReadAloud#1545
Draft
cdrini wants to merge 1 commit into
Draft
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1545 +/- ##
==========================================
+ Coverage 68.96% 68.99% +0.02%
==========================================
Files 65 65
Lines 5559 5564 +5
Branches 1231 1233 +2
==========================================
+ Hits 3834 3839 +5
Misses 1691 1691
Partials 34 34 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR filters Web Speech API voices used by ReadAloud to hide known Apple novelty or low-quality voice families.
Changes:
- Adds
WebTTSEngine.isGoodVoice()to reject selected Apple voice URI prefixes. - Applies the filter in
getVoices(). - Adds a Jest test covering the new voice filtering behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
src/plugins/tts/WebTTSEngine.js |
Adds and applies voice filtering for Web TTS voices. |
tests/jest/plugins/tts/WebTTSEngine.test.js |
Adds coverage for filtering known Apple novelty voice prefixes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+25
to
+33
| // Exclude known novelty/undesired macOS voice families (e.g. joke/system variants) | ||
| 'com.apple.speech.synthesis.voice.', | ||
| 'com.apple.eloquence.', | ||
| 'com.apple.voice.super-compact.', | ||
| ]; | ||
|
|
||
| return ( | ||
| voice.voiceURI | ||
| && !badVoicePrefixes.some(prefix => voice.voiceURI.startsWith(prefix)) |
| ]; | ||
|
|
||
| return ( | ||
| voice.voiceURI |
Comment on lines
+101
to
102
| const voices = speechSynthesis.getVoices().filter(WebTTSEngine.isGoodVoice); | ||
| if (voices.filter(v => v.default).length != 1) { |
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.
Before:
Loads of novelty voices for things like "Bubbles", which play a bubbly sound. Funny, but not super helpful :P . Or very old low quality synthesized voices like "Grandma". Most user's won't want these, so disable them.
After:
...