Merge pull request #4424 from pipecat-ai/mb/revert-elevenlabs-tts-alignment

fix(elevenlabs): only use normalizedAlignment when pronunciation dict is set
This commit is contained in:
Mark Backman
2026-05-06 08:27:25 -04:00
committed by GitHub
3 changed files with 172 additions and 18 deletions

1
changelog/4424.fixed.md Normal file
View File

@@ -0,0 +1 @@
- Fixed `ElevenLabsTTSService` and `ElevenLabsHttpTTSService` writing romanized/normalized text to the LLM context. With non-Latin input (e.g., Chinese), the assistant transcript was getting populated with pinyin (`Ni Hao !` instead of `你好!`), which then degraded subsequent LLM turns. The services now consume `alignment` by default and only switch to `normalizedAlignment` / `normalized_alignment` when `pronunciation_dictionary_locators` is configured (where `alignment` has overlapping restarts that produce duplicated/garbled words, per #4316). Both fields are read with preferred-with-fallback semantics since each is nullable per the API schema.