-
Notifications
You must be signed in to change notification settings - Fork 237
fix: support ElevenLabs non legacy voices #1054
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔴 Following the same pattern as the Root cause and impactAt const alignment =
this.#opts.preferredAlignment === 'normalized'
? (data.normalizedAlignment as Record<string, unknown>)
: (data.alignment as Record<string, unknown>);Since (Refers to lines 488-489) Was this helpful? React with 👍 or 👎 to provide feedback. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔴
isFinalnot checked asis_final, causing stream to never complete for non-legacy voicesThe PR fixes
contextIdto also checkcontext_id(snake_case) for non-legacy ElevenLabs voices, but the same snake_case issue is not addressed fordata.isFinalon line 554. If the non-legacy API returnsis_final(snake_case, consistent with returningcontext_id), theif (data.isFinal)check will always be falsy.Root cause and impact
When
data.isFinalis never truthy:stream.markDone()is never called, so#streamDonestaysfalsectx.waiter.resolve()is never called, so thewaiterPromiseinPromise.allatplugins/elevenlabs/src/tts.ts:1080never resolves#cleanupContext(contextId!)is never called, leaking context dataaudioProcessTaskloop atplugins/elevenlabs/src/tts.ts:1041-1063spins indefinitely because#streamDoneis never set totrueAudio data may still play (since
data.audiois processed before theisFinalcheck), but the stream never properly terminates. ThePromise.allhangs, leading to resource leaks and the synthesize stream never completing.The fix should mirror the
contextIdfix:(Refers to line 554)
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@adriablancafort should we also handle snake_case for other fields to keep things consistent? Or is this only an issue for context_id?