fix(cartesia): expand TTS language support and add WebSocket timestamp params#5361
Open
Namit1867 wants to merge 1 commit intolivekit:mainfrom
Open
Conversation
…p params - Expand TTSLanguages from 7 to 42 languages to match Cartesia TTS API Ref: https://docs.cartesia.ai/api-reference/tts/bytes#body-language - Add `add_phoneme_timestamps` param (WebSocket only) to request phoneme-level timing data from Cartesia Ref: https://docs.cartesia.ai/api-reference/tts/websocket - Add `use_normalized_timestamps` param (WebSocket only) to toggle timestamp normalization in streamed responses Ref: https://docs.cartesia.ai/api-reference/tts/websocket - Handle `phoneme_timestamps` key in WebSocket receive loop to avoid spurious "unexpected message" warnings when the feature is enabled Both new params are exposed on TTS.__init__ and update_options().
Contributor
Author
|
@davidzhao Could you please review my PR when you get a chance? Thanks! |
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
This PR syncs the
livekit-plugins-cartesiaTTS plugin with missing parameters from the latest Cartesia API.Changes
Language support (
models.py)TTSLanguagesfrom 7 languages (en,es,fr,de,pt,zh,ja) to the full 42 languages now supported by the Cartesia TTS APIhi,ko,it,nl,pl,ru,sv,tr,tl,bg,ro,ar,cs,el,fi,hr,ms,sk,da,ta,uk,hu,no,vi,bn,th,he,ka,id,te,gu,kn,ml,mr,or,paWebSocket-only params (
tts.py)add_phoneme_timestamps: bool = False— requests phoneme-level timing data in streamed responses. Sent asadd_phoneme_timestamps: truein the WebSocket payload when enabled.use_normalized_timestamps: bool = False— toggles timestamp normalization in streamed responses.TTS.__init__()andTTS.update_options().WebSocket response handling (
tts.py)phoneme_timestampskey in_recv_taskto avoid spurious"unexpected message"warnings whenadd_phoneme_timestampsis enabled. Phoneme timestamps are received but not currently surfaced through the output emitter (no phoneme-level transcript API exists in the basettsmodule).References