cartesia 1.0.4__py2.py3-none-any.whl → 1.0.5__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- cartesia/client.py +192 -4
- cartesia/version.py +1 -1
- cartesia-1.0.5.dist-info/LICENSE.md +21 -0
- {cartesia-1.0.4.dist-info → cartesia-1.0.5.dist-info}/METADATA +93 -13
- cartesia-1.0.5.dist-info/RECORD +12 -0
- cartesia-1.0.4.dist-info/RECORD +0 -11
- {cartesia-1.0.4.dist-info → cartesia-1.0.5.dist-info}/WHEEL +0 -0
- {cartesia-1.0.4.dist-info → cartesia-1.0.5.dist-info}/top_level.txt +0 -0
cartesia/client.py
CHANGED
@@ -7,6 +7,7 @@ from types import TracebackType
|
|
7
7
|
from typing import (
|
8
8
|
Any,
|
9
9
|
AsyncGenerator,
|
10
|
+
Iterator,
|
10
11
|
Dict,
|
11
12
|
Generator,
|
12
13
|
List,
|
@@ -14,6 +15,7 @@ from typing import (
|
|
14
15
|
Tuple,
|
15
16
|
Union,
|
16
17
|
Callable,
|
18
|
+
Set,
|
17
19
|
)
|
18
20
|
|
19
21
|
import aiohttp
|
@@ -21,6 +23,7 @@ import httpx
|
|
21
23
|
import logging
|
22
24
|
import requests
|
23
25
|
from websockets.sync.client import connect
|
26
|
+
from iterators import TimeoutIterator
|
24
27
|
|
25
28
|
from cartesia.utils.retry import retry_on_connection_error, retry_on_connection_error_async
|
26
29
|
from cartesia._types import (
|
@@ -260,6 +263,165 @@ class Voices(Resource):
|
|
260
263
|
return response.json()
|
261
264
|
|
262
265
|
|
266
|
+
class _TTSContext:
|
267
|
+
"""Manage a single context over a WebSocket.
|
268
|
+
|
269
|
+
This class can be used to stream inputs, as they become available, to a specific `context_id`. See README for usage.
|
270
|
+
|
271
|
+
See :class:`_AsyncTTSContext` for asynchronous use cases.
|
272
|
+
|
273
|
+
Each TTSContext will close automatically when a done message is received for that context. It also closes if there is an error.
|
274
|
+
"""
|
275
|
+
|
276
|
+
def __init__(self, context_id: str, websocket: "_WebSocket"):
|
277
|
+
self._context_id = context_id
|
278
|
+
self._websocket = websocket
|
279
|
+
self._error = None
|
280
|
+
|
281
|
+
def __del__(self):
|
282
|
+
self._close()
|
283
|
+
|
284
|
+
@property
|
285
|
+
def context_id(self) -> str:
|
286
|
+
return self._context_id
|
287
|
+
|
288
|
+
def send(
|
289
|
+
self,
|
290
|
+
model_id: str,
|
291
|
+
transcript: Iterator[str],
|
292
|
+
output_format: OutputFormat,
|
293
|
+
voice_id: Optional[str] = None,
|
294
|
+
voice_embedding: Optional[List[float]] = None,
|
295
|
+
context_id: Optional[str] = None,
|
296
|
+
duration: Optional[int] = None,
|
297
|
+
language: Optional[str] = None,
|
298
|
+
) -> Generator[bytes, None, None]:
|
299
|
+
"""Send audio generation requests to the WebSocket and yield responses.
|
300
|
+
|
301
|
+
Args:
|
302
|
+
model_id: The ID of the model to use for generating audio.
|
303
|
+
transcript: Iterator over text chunks with <1s latency.
|
304
|
+
output_format: A dictionary containing the details of the output format.
|
305
|
+
voice_id: The ID of the voice to use for generating audio.
|
306
|
+
voice_embedding: The embedding of the voice to use for generating audio.
|
307
|
+
context_id: The context ID to use for the request. If not specified, a random context ID will be generated.
|
308
|
+
duration: The duration of the audio in seconds.
|
309
|
+
language: The language code for the audio request. This can only be used with `model_id = sonic-multilingual`
|
310
|
+
|
311
|
+
Yields:
|
312
|
+
Dictionary containing the following key(s):
|
313
|
+
- audio: The audio as bytes.
|
314
|
+
- context_id: The context ID for the request.
|
315
|
+
|
316
|
+
Raises:
|
317
|
+
ValueError: If provided context_id doesn't match the current context.
|
318
|
+
RuntimeError: If there's an error generating audio.
|
319
|
+
"""
|
320
|
+
if context_id is not None and context_id != self._context_id:
|
321
|
+
raise ValueError("Context ID does not match the context ID of the current context.")
|
322
|
+
|
323
|
+
self._websocket.connect()
|
324
|
+
|
325
|
+
voice = self._websocket._validate_and_construct_voice(voice_id, voice_embedding)
|
326
|
+
|
327
|
+
# Create the initial request body
|
328
|
+
request_body = {
|
329
|
+
"model_id": model_id,
|
330
|
+
"voice": voice,
|
331
|
+
"output_format": {
|
332
|
+
"container": output_format["container"],
|
333
|
+
"encoding": output_format["encoding"],
|
334
|
+
"sample_rate": output_format["sample_rate"],
|
335
|
+
},
|
336
|
+
"context_id": self._context_id,
|
337
|
+
"language": language,
|
338
|
+
}
|
339
|
+
|
340
|
+
if duration is not None:
|
341
|
+
request_body["duration"] = duration
|
342
|
+
|
343
|
+
try:
|
344
|
+
# Create an iterator with a timeout to get text chunks
|
345
|
+
text_iterator = TimeoutIterator(
|
346
|
+
transcript, timeout=0.001
|
347
|
+
) # 1ms timeout for nearly non-blocking receive
|
348
|
+
next_chunk = next(text_iterator, None)
|
349
|
+
|
350
|
+
while True:
|
351
|
+
# Send the next text chunk to the WebSocket if available
|
352
|
+
if next_chunk is not None and next_chunk != text_iterator.get_sentinel():
|
353
|
+
request_body["transcript"] = next_chunk
|
354
|
+
request_body["continue"] = True
|
355
|
+
self._websocket.websocket.send(json.dumps(request_body))
|
356
|
+
next_chunk = next(text_iterator, None)
|
357
|
+
|
358
|
+
try:
|
359
|
+
# Receive responses from the WebSocket with a small timeout
|
360
|
+
response = json.loads(
|
361
|
+
self._websocket.websocket.recv(timeout=0.001)
|
362
|
+
) # 1ms timeout for nearly non-blocking receive
|
363
|
+
if response["context_id"] != self._context_id:
|
364
|
+
pass
|
365
|
+
if "error" in response:
|
366
|
+
raise RuntimeError(f"Error generating audio:\n{response['error']}")
|
367
|
+
if response["done"]:
|
368
|
+
break
|
369
|
+
if response["data"]:
|
370
|
+
yield self._websocket._convert_response(
|
371
|
+
response=response, include_context_id=True
|
372
|
+
)
|
373
|
+
except TimeoutError:
|
374
|
+
pass
|
375
|
+
|
376
|
+
# Continuously receive from WebSocket until the next text chunk is available
|
377
|
+
while next_chunk == text_iterator.get_sentinel():
|
378
|
+
try:
|
379
|
+
response = json.loads(self._websocket.websocket.recv(timeout=0.001))
|
380
|
+
if response["context_id"] != self._context_id:
|
381
|
+
continue
|
382
|
+
if "error" in response:
|
383
|
+
raise RuntimeError(f"Error generating audio:\n{response['error']}")
|
384
|
+
if response["done"]:
|
385
|
+
break
|
386
|
+
if response["data"]:
|
387
|
+
yield self._websocket._convert_response(
|
388
|
+
response=response, include_context_id=True
|
389
|
+
)
|
390
|
+
except TimeoutError:
|
391
|
+
pass
|
392
|
+
next_chunk = next(text_iterator, None)
|
393
|
+
|
394
|
+
# Send final message if all input text chunks are exhausted
|
395
|
+
if next_chunk is None:
|
396
|
+
request_body["transcript"] = ""
|
397
|
+
request_body["continue"] = False
|
398
|
+
self._websocket.websocket.send(json.dumps(request_body))
|
399
|
+
break
|
400
|
+
|
401
|
+
# Receive remaining messages from the WebSocket until "done" is received
|
402
|
+
while True:
|
403
|
+
response = json.loads(self._websocket.websocket.recv())
|
404
|
+
if response["context_id"] != self._context_id:
|
405
|
+
continue
|
406
|
+
if "error" in response:
|
407
|
+
raise RuntimeError(f"Error generating audio:\n{response['error']}")
|
408
|
+
if response["done"]:
|
409
|
+
break
|
410
|
+
yield self._websocket._convert_response(response=response, include_context_id=True)
|
411
|
+
|
412
|
+
except Exception as e:
|
413
|
+
self._websocket.close()
|
414
|
+
raise RuntimeError(f"Failed to generate audio. {e}")
|
415
|
+
|
416
|
+
def _close(self):
|
417
|
+
"""Closes the context. Automatically called when a done message is received for this context."""
|
418
|
+
self._websocket._remove_context(self._context_id)
|
419
|
+
|
420
|
+
def is_closed(self):
|
421
|
+
"""Check if the context is closed or not. Returns True if closed."""
|
422
|
+
return self._context_id not in self._websocket._contexts
|
423
|
+
|
424
|
+
|
263
425
|
class _WebSocket:
|
264
426
|
"""This class contains methods to generate audio using WebSocket. Ideal for low-latency audio generation.
|
265
427
|
|
@@ -283,6 +445,13 @@ class _WebSocket:
|
|
283
445
|
self.api_key = api_key
|
284
446
|
self.cartesia_version = cartesia_version
|
285
447
|
self.websocket = None
|
448
|
+
self._contexts: Set[str] = set()
|
449
|
+
|
450
|
+
def __del__(self):
|
451
|
+
try:
|
452
|
+
self.close()
|
453
|
+
except Exception as e:
|
454
|
+
raise RuntimeError("Failed to close WebSocket: ", e)
|
286
455
|
|
287
456
|
def connect(self):
|
288
457
|
"""This method connects to the WebSocket if it is not already connected.
|
@@ -304,9 +473,12 @@ class _WebSocket:
|
|
304
473
|
|
305
474
|
def close(self):
|
306
475
|
"""This method closes the WebSocket connection. *Highly* recommended to call this method when done using the WebSocket."""
|
307
|
-
if self.websocket
|
476
|
+
if self.websocket and not self._is_websocket_closed():
|
308
477
|
self.websocket.close()
|
309
478
|
|
479
|
+
if self._contexts:
|
480
|
+
self._contexts.clear()
|
481
|
+
|
310
482
|
def _convert_response(
|
311
483
|
self, response: Dict[str, any], include_context_id: bool
|
312
484
|
) -> Dict[str, Any]:
|
@@ -426,10 +598,22 @@ class _WebSocket:
|
|
426
598
|
yield self._convert_response(response=response, include_context_id=True)
|
427
599
|
except Exception as e:
|
428
600
|
# Close the websocket connection if an error occurs.
|
429
|
-
|
430
|
-
self.websocket.close()
|
601
|
+
self.close()
|
431
602
|
raise RuntimeError(f"Failed to generate audio. {response}") from e
|
432
603
|
|
604
|
+
def _remove_context(self, context_id: str):
|
605
|
+
if context_id in self._contexts:
|
606
|
+
self._contexts.remove(context_id)
|
607
|
+
|
608
|
+
def context(self, context_id: Optional[str] = None) -> _TTSContext:
|
609
|
+
if context_id in self._contexts:
|
610
|
+
raise ValueError(f"Context for context ID {context_id} already exists.")
|
611
|
+
if context_id is None:
|
612
|
+
context_id = str(uuid.uuid4())
|
613
|
+
if context_id not in self._contexts:
|
614
|
+
self._contexts.add(context_id)
|
615
|
+
return _TTSContext(context_id, self)
|
616
|
+
|
433
617
|
|
434
618
|
class _SSE:
|
435
619
|
"""This class contains methods to generate audio using Server-Sent Events.
|
@@ -826,7 +1010,7 @@ class _AsyncSSE(_SSE):
|
|
826
1010
|
|
827
1011
|
|
828
1012
|
class _AsyncTTSContext:
|
829
|
-
"""Manage a single context over
|
1013
|
+
"""Manage a single context over an AsyncWebSocket.
|
830
1014
|
|
831
1015
|
This class separates sending requests and receiving responses into two separate methods.
|
832
1016
|
This can be used for sending multiple requests without awaiting the response.
|
@@ -945,6 +1129,10 @@ class _AsyncTTSContext:
|
|
945
1129
|
"""Closes the context. Automatically called when a done message is received for this context."""
|
946
1130
|
self._websocket._remove_context(self._context_id)
|
947
1131
|
|
1132
|
+
def is_closed(self):
|
1133
|
+
"""Check if the context is closed or not. Returns True if closed."""
|
1134
|
+
return self._context_id not in self._websocket._context_queues
|
1135
|
+
|
948
1136
|
async def __aenter__(self):
|
949
1137
|
return self
|
950
1138
|
|
cartesia/version.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
__version__ = "1.0.
|
1
|
+
__version__ = "1.0.5"
|
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2024 Cartesia AI, Inc.
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: cartesia
|
3
|
-
Version: 1.0.
|
3
|
+
Version: 1.0.5
|
4
4
|
Summary: The official Python library for the Cartesia API.
|
5
5
|
Home-page:
|
6
6
|
Author: Cartesia, Inc.
|
@@ -10,11 +10,13 @@ Classifier: Programming Language :: Python :: 3
|
|
10
10
|
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
11
11
|
Requires-Python: >=3.8.0
|
12
12
|
Description-Content-Type: text/markdown
|
13
|
+
License-File: LICENSE.md
|
13
14
|
Requires-Dist: aiohttp
|
14
15
|
Requires-Dist: httpx
|
15
16
|
Requires-Dist: pytest-asyncio
|
16
17
|
Requires-Dist: requests
|
17
18
|
Requires-Dist: websockets
|
19
|
+
Requires-Dist: iterators
|
18
20
|
Provides-Extra: all
|
19
21
|
Requires-Dist: pytest >=8.0.2 ; extra == 'all'
|
20
22
|
Requires-Dist: pytest-cov >=4.1.0 ; extra == 'all'
|
@@ -97,10 +99,10 @@ voice = client.voices.get(id=voice_id)
|
|
97
99
|
|
98
100
|
transcript = "Hello! Welcome to Cartesia"
|
99
101
|
|
100
|
-
# You can check out our models at
|
102
|
+
# You can check out our models at https://docs.cartesia.ai/getting-started/available-models
|
101
103
|
model_id = "sonic-english"
|
102
104
|
|
103
|
-
# You can find the supported `output_format`s
|
105
|
+
# You can find the supported `output_format`s at https://docs.cartesia.ai/api-reference/endpoints/stream-speech-server-sent-events
|
104
106
|
output_format = {
|
105
107
|
"container": "raw",
|
106
108
|
"encoding": "pcm_f32le",
|
@@ -148,10 +150,10 @@ async def write_stream():
|
|
148
150
|
voice_id = "a0e99841-438c-4a64-b679-ae501e7d6091"
|
149
151
|
voice = client.voices.get(id=voice_id)
|
150
152
|
transcript = "Hello! Welcome to Cartesia"
|
151
|
-
# You can check out our models at
|
153
|
+
# You can check out our models at https://docs.cartesia.ai/getting-started/available-models
|
152
154
|
model_id = "sonic-english"
|
153
155
|
|
154
|
-
# You can find the supported `output_format`s
|
156
|
+
# You can find the supported `output_format`s at https://docs.cartesia.ai/api-reference/endpoints/stream-speech-server-sent-events
|
155
157
|
output_format = {
|
156
158
|
"container": "raw",
|
157
159
|
"encoding": "pcm_f32le",
|
@@ -203,10 +205,10 @@ voice_id = "a0e99841-438c-4a64-b679-ae501e7d6091"
|
|
203
205
|
voice = client.voices.get(id=voice_id)
|
204
206
|
transcript = "Hello! Welcome to Cartesia"
|
205
207
|
|
206
|
-
# You can check out our models at
|
208
|
+
# You can check out our models at https://docs.cartesia.ai/getting-started/available-models
|
207
209
|
model_id = "sonic-english"
|
208
210
|
|
209
|
-
# You can find the supported `output_format`s
|
211
|
+
# You can find the supported `output_format`s at https://docs.cartesia.ai/api-reference/endpoints/stream-speech-server-sent-events
|
210
212
|
output_format = {
|
211
213
|
"container": "raw",
|
212
214
|
"encoding": "pcm_f32le",
|
@@ -250,7 +252,7 @@ In some cases, input text may need to be streamed in. In these cases, it would b
|
|
250
252
|
|
251
253
|
To mitigate this, Cartesia offers audio continuations. In this setting, users can send input text, as it becomes available, over a websocket connection.
|
252
254
|
|
253
|
-
To do this, we will create a `context` and
|
255
|
+
To do this, we will create a `context` and send multiple requests without awaiting the response. Then you can listen to the responses in the order they were sent.
|
254
256
|
|
255
257
|
Each `context` will be closed automatically after 5 seconds of inactivity or when the `no_more_inputs` method is called. `no_more_inputs` sends a request with the `continue_=False`, which indicates no more inputs will be sent over this context
|
256
258
|
|
@@ -261,13 +263,13 @@ import pyaudio
|
|
261
263
|
from cartesia import AsyncCartesia
|
262
264
|
|
263
265
|
async def send_transcripts(ctx):
|
264
|
-
# Check out voice IDs by calling `client.voices.list()` or on
|
266
|
+
# Check out voice IDs by calling `client.voices.list()` or on https://play.cartesia.ai/
|
265
267
|
voice_id = "87748186-23bb-4158-a1eb-332911b0b708"
|
266
268
|
|
267
|
-
# You can check out our models at
|
269
|
+
# You can check out our models at https://docs.cartesia.ai/getting-started/available-models
|
268
270
|
model_id = "sonic-english"
|
269
271
|
|
270
|
-
# You can find the supported `output_format`s
|
272
|
+
# You can find the supported `output_format`s at https://docs.cartesia.ai/api-reference/endpoints/stream-speech-server-sent-events
|
271
273
|
output_format = {
|
272
274
|
"container": "raw",
|
273
275
|
"encoding": "pcm_f32le",
|
@@ -339,6 +341,84 @@ async def stream_and_listen():
|
|
339
341
|
asyncio.run(stream_and_listen())
|
340
342
|
```
|
341
343
|
|
344
|
+
You can also use continuations on the synchronous Cartesia client to stream in text as it becomes available. To do this, pass in a text generator that produces text chunks at intervals of less than 1 second, as shown below. This ensures smooth audio playback.
|
345
|
+
|
346
|
+
Note: the sync client has a different API for continuations compared to the async client.
|
347
|
+
|
348
|
+
```python
|
349
|
+
from cartesia import Cartesia
|
350
|
+
import pyaudio
|
351
|
+
import os
|
352
|
+
|
353
|
+
client = Cartesia(api_key=os.environ.get("CARTESIA_API_KEY"))
|
354
|
+
|
355
|
+
transcripts = [
|
356
|
+
"The crew engaged in a range of activities designed to mirror those "
|
357
|
+
"they might perform on a real Mars mission. ",
|
358
|
+
"Aside from growing vegetables and maintaining their habitat, they faced "
|
359
|
+
"additional stressors like communication delays with Earth, ",
|
360
|
+
"up to twenty-two minutes each way, to simulate the distance from Mars to our planet. ",
|
361
|
+
"These exercises were critical for understanding how astronauts can "
|
362
|
+
"maintain not just physical health but also mental well-being under such challenging conditions. ",
|
363
|
+
]
|
364
|
+
|
365
|
+
# Ending each transcript with a space makes the audio smoother
|
366
|
+
def chunk_generator(transcripts):
|
367
|
+
for transcript in transcripts:
|
368
|
+
if transcript.endswith(" "):
|
369
|
+
yield transcript
|
370
|
+
else:
|
371
|
+
yield transcript + " "
|
372
|
+
|
373
|
+
|
374
|
+
# You can check out voice IDs by calling `client.voices.list()` or on https://play.cartesia.ai/
|
375
|
+
voice_id = "87748186-23bb-4158-a1eb-332911b0b708"
|
376
|
+
|
377
|
+
# You can check out our models at https://docs.cartesia.ai/getting-started/available-models
|
378
|
+
model_id = "sonic-english"
|
379
|
+
|
380
|
+
# You can find the supported `output_format`s at https://docs.cartesia.ai/api-reference/endpoints/stream-speech-server-sent-events
|
381
|
+
output_format = {
|
382
|
+
"container": "raw",
|
383
|
+
"encoding": "pcm_f32le",
|
384
|
+
"sample_rate": 44100,
|
385
|
+
}
|
386
|
+
|
387
|
+
p = pyaudio.PyAudio()
|
388
|
+
rate = 44100
|
389
|
+
|
390
|
+
stream = None
|
391
|
+
|
392
|
+
# Set up the websocket connection
|
393
|
+
ws = client.tts.websocket()
|
394
|
+
|
395
|
+
# Create a context to send and receive audio
|
396
|
+
ctx = ws.context() # Generates a random context ID if not provided
|
397
|
+
|
398
|
+
# Pass in a text generator to generate & stream the audio
|
399
|
+
output_stream = ctx.send(
|
400
|
+
model_id=model_id,
|
401
|
+
transcript=chunk_generator(transcripts),
|
402
|
+
voice_id=voice_id,
|
403
|
+
output_format=output_format,
|
404
|
+
)
|
405
|
+
|
406
|
+
for output in output_stream:
|
407
|
+
buffer = output["audio"]
|
408
|
+
|
409
|
+
if not stream:
|
410
|
+
stream = p.open(format=pyaudio.paFloat32, channels=1, rate=rate, output=True)
|
411
|
+
|
412
|
+
# Write the audio data to the stream
|
413
|
+
stream.write(buffer)
|
414
|
+
|
415
|
+
stream.stop_stream()
|
416
|
+
stream.close()
|
417
|
+
p.terminate()
|
418
|
+
|
419
|
+
ws.close() # Close the websocket connection
|
420
|
+
```
|
421
|
+
|
342
422
|
### Multilingual Text-to-Speech [Alpha]
|
343
423
|
|
344
424
|
You can use our `sonic-multilingual` model to generate audio in multiple languages. The languages supported are available at [docs.cartesia.ai](https://docs.cartesia.ai/getting-started/available-models).
|
@@ -356,10 +436,10 @@ voice = client.voices.get(id=voice_id)
|
|
356
436
|
transcript = "Hola! Bienvenido a Cartesia"
|
357
437
|
language = "es" # Language code corresponding to the language of the transcript
|
358
438
|
|
359
|
-
# Make sure you use the multilingual model! You can check out all models at
|
439
|
+
# Make sure you use the multilingual model! You can check out all models at https://docs.cartesia.ai/getting-started/available-models
|
360
440
|
model_id = "sonic-multilingual"
|
361
441
|
|
362
|
-
# You can find the supported `output_format`s
|
442
|
+
# You can find the supported `output_format`s at https://docs.cartesia.ai/api-reference/endpoints/stream-speech-server-sent-events
|
363
443
|
output_format = {
|
364
444
|
"container": "raw",
|
365
445
|
"encoding": "pcm_f32le",
|
@@ -0,0 +1,12 @@
|
|
1
|
+
cartesia/__init__.py,sha256=jMIf2O7dTGxvTA5AfXtmh1H_EGfMtQseR5wXrjNRbLs,93
|
2
|
+
cartesia/_types.py,sha256=tO3Nef_V78TDMKDuIv_wsQLkxoSvYG4bdzFkMGXUFho,3765
|
3
|
+
cartesia/client.py,sha256=46XiKTXa0gBXJ_GftMtLHAzBoX0GmWz_aWYuG68jaNQ,49316
|
4
|
+
cartesia/version.py,sha256=B9kKWJLln1i8LjtkcYecvNWGLTrez4gCUOHtnPlInFo,22
|
5
|
+
cartesia/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
6
|
+
cartesia/utils/deprecated.py,sha256=2cXvGtrxhPeUZA5LWy2n_U5OFLDv7SHeFtzqhjSJGyk,1674
|
7
|
+
cartesia/utils/retry.py,sha256=nuwWRfu3MOVTxIQMLjYf6WLaxSlnu_GdE3QjTV0zisQ,3339
|
8
|
+
cartesia-1.0.5.dist-info/LICENSE.md,sha256=PT2YG5wEtEX1TNDn5sXkUXqbn-neyr7cZenTxd40ql4,1074
|
9
|
+
cartesia-1.0.5.dist-info/METADATA,sha256=PImHYCNoo7iSnm3Br6PuRdqvli92c7AyXR4iagdv-d8,18368
|
10
|
+
cartesia-1.0.5.dist-info/WHEEL,sha256=DZajD4pwLWue70CAfc7YaxT1wLUciNBvN_TTcvXpltE,110
|
11
|
+
cartesia-1.0.5.dist-info/top_level.txt,sha256=rTX4HnnCegMxl1FK9czpVC7GAvf3SwDzPG65qP-BS4w,9
|
12
|
+
cartesia-1.0.5.dist-info/RECORD,,
|
cartesia-1.0.4.dist-info/RECORD
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
cartesia/__init__.py,sha256=jMIf2O7dTGxvTA5AfXtmh1H_EGfMtQseR5wXrjNRbLs,93
|
2
|
-
cartesia/_types.py,sha256=tO3Nef_V78TDMKDuIv_wsQLkxoSvYG4bdzFkMGXUFho,3765
|
3
|
-
cartesia/client.py,sha256=UCNTAU8eVzb-o-bygxfQQXWTDov_FX8dbAQdn7a8Hr0,41458
|
4
|
-
cartesia/version.py,sha256=acuR_XSJzp4OrQ5T8-Ac5gYe48mUwObuwjRmisFmZ7k,22
|
5
|
-
cartesia/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
6
|
-
cartesia/utils/deprecated.py,sha256=2cXvGtrxhPeUZA5LWy2n_U5OFLDv7SHeFtzqhjSJGyk,1674
|
7
|
-
cartesia/utils/retry.py,sha256=nuwWRfu3MOVTxIQMLjYf6WLaxSlnu_GdE3QjTV0zisQ,3339
|
8
|
-
cartesia-1.0.4.dist-info/METADATA,sha256=N7NoGr6XBtmLI6EHsG3efw0QNJ7uhV_E9HV8uqTYfQM,15991
|
9
|
-
cartesia-1.0.4.dist-info/WHEEL,sha256=DZajD4pwLWue70CAfc7YaxT1wLUciNBvN_TTcvXpltE,110
|
10
|
-
cartesia-1.0.4.dist-info/top_level.txt,sha256=rTX4HnnCegMxl1FK9czpVC7GAvf3SwDzPG65qP-BS4w,9
|
11
|
-
cartesia-1.0.4.dist-info/RECORD,,
|
File without changes
|
File without changes
|