fix(tts): make the ElevenLabs voice id field drive the voice that plays - #156
Merged
Conversation
The ElevenLabs custom voice box wrote to the provider config while the speech pipeline read the speech module's activeVoiceId, which the provider switch had already set to the first declared voice. Every pasted id was shadowed, so ElevenLabs users always heard Rachel (issue #153). - the field now edits activeVoiceId through handleTTSVoiceChange like every other provider, with the declared voices offered as a datalist; same in the onboarding twin - one-time migration at startup moves a legacy custom id into activeVoiceId when the active voice is still the provider default, then clears the old slot so it can never re-fire - the pipeline reads a single slot again; the settings store loses the dead getter and setter - the TTS settings state seeds its model list from the cache on init, so a provider without static models shows the saved model instead of the placeholder until refresh
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Fixes #153.
Root cause
Selecting ElevenLabs (settings dropdown or onboarding) sets
speech.activeVoiceIdto the first declared voice, Rachel21m00Tcm4TlvDq8ikWAM. The "Custom Voice ID" box wrote to a different slot,providerConfigs.elevenlabs.voiceId, and the pipeline resolvedactiveVoiceId || ttsConfig.voiceId. Rachel is never empty, so every pasted id was shadowed. Reproduced against a mock ElevenLabs with the reporter's exact stored state: three requests totext-to-speech/21m00Tcm4TlvDq8ikWAM/streamwhile the custom id sat unused. That matches "ElevenLabs receives the requests, the voice does not change".Change
activeVoiceIdthroughhandleTTSVoiceChange, the same path every other provider uses, with the declared voices as a native datalist. Onboarding twin gets the same treatment.legacy-voice-migration.ts, decision inlegacyVoiceToAdopt): if a legacy custom id exists and the active voice is empty or still the provider default, it moves across. The legacy slot is cleared either way so the migration can never fire twice or apply an ElevenLabs voice to another provider. Users who had a legacy id but are on a different TTS provider lose an id that was never in effect and will see the real slot when they switch back.Verification
pnpm test440 pass (5 new forlegacyVoiceToAdopt),pnpm check0 errors 0 warnings.activeVoiceIdRachel plus a legacy custom id, reloaded,activeVoiceIdbecame the custom id and the legacy slot was removed, API key kept.text-to-speech/JBFqnCBsd6RMkjVDRZzb/streamcalls (George, not in our declared list), all 200audio/mpeg.activeVoiceIdupdated, model dropdown showed "Eleven Turbo v2.5" after refresh and again after a full reload without refresh.Notes
voiceId:line incompanion-chat.tsas Feature/multilingual tts #154; whichever merges second gets a one-line conflict.db/export.tsuses an anchor download), andElevenLabsTTSdefaults to Bella when the voice is empty while the registry's first voice is Rachel.