Repository navigation
feat(web): report the default TTS voice as active - #378
Open
ddfreiling wants to merge 3 commits into
Open
ddfreiling wants to merge 3 commits into
ddfreiling wants to merge 3 commits into
Conversation
Apps show an empty voice picker until the user chooses a voice, because only the web plugin knows which voice pickDefaultVoice uses. ttsGetAvailableVoices now sets active on that voice for each primary language, so the scoring stays in defaultVoice.ts and no new API is needed. The example voice dropdown shows the active voice as "(default)" when none is chosen. ADR 0003 records the per-platform meaning of active and the native follow-up. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…in use On web, active marks the default voice and ignores ttsSetVoice, so the old lead sentence misled apps into reading it as the current voice. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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
Apps cannot show which voice web read-aloud uses until the user picks one, so voice pickers stay empty. The plugin picks that voice itself (
pickDefaultVoice), usingvoice.defaultand the@readium/speechquality lists, which Dart doesn't have. This PR reports the pick through the existingReaderTTSVoice.activefield instead of adding API.Change
ttsGetAvailableVoicessetsactive: trueon the voicepickDefaultVoicepicks for each primary language, andfalseon the rest. The scoring stays indefaultVoice.ts.activevoice as "Name (default)", else "Select voice".activemeans per platform, and a follow-up for native. The TTS guide and theactivedoc comment point to it.Review notes
activemeans different things per platform: the default pick on web, the app's chosen voice on Android, unset on iOS. A follow-up to report native defaults the same way would change Android's meaning, so the ADR leaves that as a separate decision.en), while speech uses the full tag (en-GB, +2 for an exact region). They differ only when several local, non-default voices of one language but different regions are installed and the text carries a region tag. The ADR names the exact alternative (use the open publication's language) and why it wasn't taken.Verification
npm test(576 tests, including a newserializeVoicestest),bin/typecheck,bin/format,bin/analyze,bin/changelog check.da-DK: Sara (Enhanced),en-GB: Daniel,de-DE: Anna,sv-SE: Alva. In a Danish book the dropdown showed "Sara (Enhanced) (default)". After choosing Magnus it showed "Magnus (Enhanced)".Not covered