Skip to content

Commit c372fa5

Browse files
authored
[Cartesia] Adding new model literals, updating default to sonic-2 (#1626)
1 parent fab0a76 commit c372fa5

File tree

2 files changed

+4
-4
lines changed
  • livekit-plugins/livekit-plugins-cartesia/livekit/plugins/cartesia

2 files changed

+4
-4
lines changed

livekit-plugins/livekit-plugins-cartesia/livekit/plugins/cartesia/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# "pcm_alaw",
99
]
1010

11-
TTSModels = Literal["sonic-english", "sonic-multilingual"]
11+
TTSModels = Literal["sonic", "sonic-2", "sonic-lite", "sonic-preview", "sonic-turbo"]
1212
TTSLanguages = Literal["en", "es", "fr", "de", "pt", "zh", "ja"]
1313
TTSDefaultVoiceId = "794f9389-aac1-45b6-b726-9d9369183238"
1414
TTSVoiceSpeed = Literal["fastest", "fast", "normal", "slow", "slowest"]

livekit-plugins/livekit-plugins-cartesia/livekit/plugins/cartesia/tts.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class TTS(tts.TTS):
7373
def __init__(
7474
self,
7575
*,
76-
model: TTSModels | str = "sonic",
76+
model: TTSModels | str = "sonic-2",
7777
language: str = "en",
7878
encoding: TTSEncoding = "pcm_s16le",
7979
voice: str | list[float] = TTSDefaultVoiceId,
@@ -90,7 +90,7 @@ def __init__(
9090
See https://docs.cartesia.ai/reference/web-socket/stream-speech/stream-speech for more details on the the Cartesia API.
9191
9292
Args:
93-
model (TTSModels, optional): The Cartesia TTS model to use. Defaults to "sonic-english".
93+
model (TTSModels, optional): The Cartesia TTS model to use. Defaults to "sonic-2".
9494
language (str, optional): The language code for synthesis. Defaults to "en".
9595
encoding (TTSEncoding, optional): The audio encoding format. Defaults to "pcm_s16le".
9696
voice (str | list[float], optional): The voice ID or embedding array.
@@ -169,7 +169,7 @@ def update_options(
169169
and emotion. If any parameter is not provided, the existing value will be retained.
170170
171171
Args:
172-
model (TTSModels, optional): The Cartesia TTS model to use. Defaults to "sonic-english".
172+
model (TTSModels, optional): The Cartesia TTS model to use. Defaults to "sonic-2".
173173
language (str, optional): The language code for synthesis. Defaults to "en".
174174
voice (str | list[float], optional): The voice ID or embedding array.
175175
speed (TTSVoiceSpeed | float, optional): Voice Control - Speed (https://docs.cartesia.ai/user-guides/voice-control)

0 commit comments

Comments
 (0)