cartesia 1.0.12__py2.py3-none-any.whl → 1.0.14__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/__init__.py +2 -1
- cartesia/_async_sse.py +105 -0
- cartesia/_async_websocket.py +323 -0
- cartesia/_constants.py +10 -0
- cartesia/_logger.py +3 -0
- cartesia/_sse.py +152 -0
- cartesia/_types.py +3 -2
- cartesia/_websocket.py +374 -0
- cartesia/async_client.py +82 -0
- cartesia/async_tts.py +22 -0
- cartesia/client.py +4 -1325
- cartesia/resource.py +44 -0
- cartesia/tts.py +109 -0
- cartesia/utils/tts.py +25 -0
- cartesia/version.py +1 -1
- cartesia/voices.py +170 -0
- {cartesia-1.0.12.dist-info → cartesia-1.0.14.dist-info}/METADATA +14 -10
- cartesia-1.0.14.dist-info/RECORD +24 -0
- cartesia-1.0.12.dist-info/RECORD +0 -12
- {cartesia-1.0.12.dist-info → cartesia-1.0.14.dist-info}/LICENSE.md +0 -0
- {cartesia-1.0.12.dist-info → cartesia-1.0.14.dist-info}/WHEEL +0 -0
- {cartesia-1.0.12.dist-info → cartesia-1.0.14.dist-info}/top_level.txt +0 -0
cartesia/resource.py
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
from cartesia._constants import DEFAULT_CARTESIA_VERSION
|
2
|
+
|
3
|
+
|
4
|
+
class Resource:
|
5
|
+
def __init__(
|
6
|
+
self,
|
7
|
+
api_key: str,
|
8
|
+
base_url: str,
|
9
|
+
timeout: float,
|
10
|
+
):
|
11
|
+
"""Constructor for the Resource class. Used by the Voices and TTS classes."""
|
12
|
+
self.api_key = api_key
|
13
|
+
self.timeout = timeout
|
14
|
+
self._base_url = base_url
|
15
|
+
self.cartesia_version = DEFAULT_CARTESIA_VERSION
|
16
|
+
self.headers = {
|
17
|
+
"X-API-Key": self.api_key,
|
18
|
+
"Cartesia-Version": self.cartesia_version,
|
19
|
+
"Content-Type": "application/json",
|
20
|
+
}
|
21
|
+
|
22
|
+
@property
|
23
|
+
def base_url(self):
|
24
|
+
return self._base_url
|
25
|
+
|
26
|
+
def _http_url(self):
|
27
|
+
"""Returns the HTTP URL for the Cartesia API.
|
28
|
+
If the base URL is localhost, the URL will start with 'http'. Otherwise, it will start with 'https'.
|
29
|
+
"""
|
30
|
+
if self._base_url.startswith("http://") or self._base_url.startswith("https://"):
|
31
|
+
return self._base_url
|
32
|
+
else:
|
33
|
+
prefix = "http" if "localhost" in self._base_url else "https"
|
34
|
+
return f"{prefix}://{self._base_url}"
|
35
|
+
|
36
|
+
def _ws_url(self):
|
37
|
+
"""Returns the WebSocket URL for the Cartesia API.
|
38
|
+
If the base URL is localhost, the URL will start with 'ws'. Otherwise, it will start with 'wss'.
|
39
|
+
"""
|
40
|
+
if self._base_url.startswith("ws://") or self._base_url.startswith("wss://"):
|
41
|
+
return self._base_url
|
42
|
+
else:
|
43
|
+
prefix = "ws" if "localhost" in self._base_url else "wss"
|
44
|
+
return f"{prefix}://{self._base_url}"
|
cartesia/tts.py
ADDED
@@ -0,0 +1,109 @@
|
|
1
|
+
from typing import List, Optional
|
2
|
+
|
3
|
+
from cartesia._sse import _SSE
|
4
|
+
from cartesia._types import (
|
5
|
+
DeprecatedOutputFormatMapping,
|
6
|
+
OutputFormat,
|
7
|
+
OutputFormatMapping,
|
8
|
+
VoiceControls,
|
9
|
+
)
|
10
|
+
from cartesia._websocket import _WebSocket
|
11
|
+
from cartesia.resource import Resource
|
12
|
+
from cartesia.utils.tts import _validate_and_construct_voice
|
13
|
+
|
14
|
+
|
15
|
+
class TTS(Resource):
|
16
|
+
"""This resource contains methods to generate audio using Cartesia's text-to-speech API."""
|
17
|
+
|
18
|
+
def __init__(self, api_key: str, base_url: str, timeout: float):
|
19
|
+
super().__init__(
|
20
|
+
api_key=api_key,
|
21
|
+
base_url=base_url,
|
22
|
+
timeout=timeout,
|
23
|
+
)
|
24
|
+
self._sse_class = _SSE(self._http_url(), self.headers, self.timeout)
|
25
|
+
self.sse = self._sse_class.send
|
26
|
+
|
27
|
+
def websocket(self) -> _WebSocket:
|
28
|
+
"""This method returns a WebSocket object that can be used to generate audio using WebSocket.
|
29
|
+
|
30
|
+
Returns:
|
31
|
+
_WebSocket: A WebSocket object that can be used to generate audio using WebSocket.
|
32
|
+
"""
|
33
|
+
ws = _WebSocket(self._ws_url(), self.api_key, self.cartesia_version)
|
34
|
+
ws.connect()
|
35
|
+
return ws
|
36
|
+
|
37
|
+
@staticmethod
|
38
|
+
def get_output_format(output_format_name: str) -> OutputFormat:
|
39
|
+
"""Convenience method to get the output_format dictionary from a given output format name.
|
40
|
+
|
41
|
+
Args:
|
42
|
+
output_format_name (str): The name of the output format.
|
43
|
+
|
44
|
+
Returns:
|
45
|
+
OutputFormat: A dictionary containing the details of the output format to be passed into tts.sse() or tts.websocket().send()
|
46
|
+
|
47
|
+
Raises:
|
48
|
+
ValueError: If the output_format name is not supported
|
49
|
+
"""
|
50
|
+
if output_format_name in OutputFormatMapping._format_mapping:
|
51
|
+
output_format_obj = OutputFormatMapping.get_format(output_format_name)
|
52
|
+
elif output_format_name in DeprecatedOutputFormatMapping._format_mapping:
|
53
|
+
output_format_obj = DeprecatedOutputFormatMapping.get_format_deprecated(
|
54
|
+
output_format_name
|
55
|
+
)
|
56
|
+
else:
|
57
|
+
raise ValueError(f"Unsupported format: {output_format_name}")
|
58
|
+
|
59
|
+
return OutputFormat(
|
60
|
+
container=output_format_obj["container"],
|
61
|
+
encoding=output_format_obj["encoding"],
|
62
|
+
sample_rate=output_format_obj["sample_rate"],
|
63
|
+
)
|
64
|
+
|
65
|
+
@staticmethod
|
66
|
+
def get_sample_rate(output_format_name: str) -> int:
|
67
|
+
"""Convenience method to get the sample rate for a given output format.
|
68
|
+
|
69
|
+
Args:
|
70
|
+
output_format_name (str): The name of the output format.
|
71
|
+
|
72
|
+
Returns:
|
73
|
+
int: The sample rate for the output format.
|
74
|
+
|
75
|
+
Raises:
|
76
|
+
ValueError: If the output_format name is not supported
|
77
|
+
"""
|
78
|
+
if output_format_name in OutputFormatMapping._format_mapping:
|
79
|
+
output_format_obj = OutputFormatMapping.get_format(output_format_name)
|
80
|
+
elif output_format_name in DeprecatedOutputFormatMapping._format_mapping:
|
81
|
+
output_format_obj = DeprecatedOutputFormatMapping.get_format_deprecated(
|
82
|
+
output_format_name
|
83
|
+
)
|
84
|
+
else:
|
85
|
+
raise ValueError(f"Unsupported format: {output_format_name}")
|
86
|
+
|
87
|
+
return output_format_obj["sample_rate"]
|
88
|
+
|
89
|
+
@staticmethod
|
90
|
+
def _validate_and_construct_voice(
|
91
|
+
voice_id: Optional[str] = None,
|
92
|
+
voice_embedding: Optional[List[float]] = None,
|
93
|
+
experimental_voice_controls: Optional[VoiceControls] = None,
|
94
|
+
) -> dict:
|
95
|
+
"""Validate and construct the voice dictionary for the request.
|
96
|
+
|
97
|
+
Args:
|
98
|
+
voice_id: The ID of the voice to use for generating audio.
|
99
|
+
voice_embedding: The embedding of the voice to use for generating audio.
|
100
|
+
experimental_voice_controls: Voice controls for emotion and speed.
|
101
|
+
Note: This is an experimental feature and may rapidly change in the future.
|
102
|
+
|
103
|
+
Returns:
|
104
|
+
A dictionary representing the voice configuration.
|
105
|
+
|
106
|
+
Raises:
|
107
|
+
ValueError: If neither or both voice_id and voice_embedding are specified.
|
108
|
+
"""
|
109
|
+
return _validate_and_construct_voice(voice_id, voice_embedding, experimental_voice_controls)
|
cartesia/utils/tts.py
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
from typing import List, Optional
|
2
|
+
|
3
|
+
from cartesia._types import VoiceControls
|
4
|
+
|
5
|
+
|
6
|
+
def _validate_and_construct_voice(
|
7
|
+
voice_id: Optional[str] = None,
|
8
|
+
voice_embedding: Optional[List[float]] = None,
|
9
|
+
experimental_voice_controls: Optional[VoiceControls] = None,
|
10
|
+
) -> dict:
|
11
|
+
if voice_id is None and voice_embedding is None:
|
12
|
+
raise ValueError("Either voice_id or voice_embedding must be specified.")
|
13
|
+
|
14
|
+
voice = {}
|
15
|
+
|
16
|
+
if voice_id is not None:
|
17
|
+
voice["id"] = voice_id
|
18
|
+
|
19
|
+
if voice_embedding is not None:
|
20
|
+
voice["embedding"] = voice_embedding
|
21
|
+
|
22
|
+
if experimental_voice_controls is not None:
|
23
|
+
voice["__experimental_controls"] = experimental_voice_controls
|
24
|
+
|
25
|
+
return voice
|
cartesia/version.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
__version__ = "1.0.
|
1
|
+
__version__ = "1.0.14"
|
cartesia/voices.py
ADDED
@@ -0,0 +1,170 @@
|
|
1
|
+
from typing import Dict, List, Optional, Union
|
2
|
+
|
3
|
+
import httpx
|
4
|
+
|
5
|
+
from cartesia._types import VoiceMetadata
|
6
|
+
from cartesia.resource import Resource
|
7
|
+
|
8
|
+
|
9
|
+
class Voices(Resource):
|
10
|
+
"""This resource contains methods to list, get, clone, and create voices in your Cartesia voice library.
|
11
|
+
|
12
|
+
Usage:
|
13
|
+
>>> client = Cartesia(api_key="your_api_key")
|
14
|
+
>>> voices = client.voices.list()
|
15
|
+
>>> voice = client.voices.get(id="a0e99841-438c-4a64-b679-ae501e7d6091")
|
16
|
+
>>> print("Voice Name:", voice["name"], "Voice Description:", voice["description"])
|
17
|
+
>>> embedding = client.voices.clone(filepath="path/to/clip.wav")
|
18
|
+
>>> new_voice = client.voices.create(
|
19
|
+
... name="My Voice", description="A new voice", embedding=embedding
|
20
|
+
... )
|
21
|
+
"""
|
22
|
+
|
23
|
+
def list(self) -> List[VoiceMetadata]:
|
24
|
+
"""List all voices in your voice library.
|
25
|
+
|
26
|
+
Returns:
|
27
|
+
This method returns a list of VoiceMetadata objects.
|
28
|
+
"""
|
29
|
+
response = httpx.get(
|
30
|
+
f"{self._http_url()}/voices",
|
31
|
+
headers=self.headers,
|
32
|
+
timeout=self.timeout,
|
33
|
+
)
|
34
|
+
|
35
|
+
if not response.is_success:
|
36
|
+
raise ValueError(f"Failed to get voices. Error: {response.text}")
|
37
|
+
|
38
|
+
voices = response.json()
|
39
|
+
return voices
|
40
|
+
|
41
|
+
def get(self, id: str) -> VoiceMetadata:
|
42
|
+
"""Get a voice by its ID.
|
43
|
+
|
44
|
+
Args:
|
45
|
+
id: The ID of the voice.
|
46
|
+
|
47
|
+
Returns:
|
48
|
+
A VoiceMetadata object containing the voice metadata.
|
49
|
+
"""
|
50
|
+
url = f"{self._http_url()}/voices/{id}"
|
51
|
+
response = httpx.get(url, headers=self.headers, timeout=self.timeout)
|
52
|
+
|
53
|
+
if not response.is_success:
|
54
|
+
raise ValueError(
|
55
|
+
f"Failed to get voice. Status Code: {response.status_code}\n"
|
56
|
+
f"Error: {response.text}"
|
57
|
+
)
|
58
|
+
|
59
|
+
return response.json()
|
60
|
+
|
61
|
+
def clone(self, filepath: Optional[str] = None, enhance: str = True) -> List[float]:
|
62
|
+
"""Clone a voice from a clip.
|
63
|
+
|
64
|
+
Args:
|
65
|
+
filepath: The path to the clip file.
|
66
|
+
enhance: Whether to enhance the clip before cloning the voice (highly recommended). Defaults to True.
|
67
|
+
|
68
|
+
Returns:
|
69
|
+
The embedding of the cloned voice as a list of floats.
|
70
|
+
"""
|
71
|
+
if not filepath:
|
72
|
+
raise ValueError("Filepath must be specified.")
|
73
|
+
url = f"{self._http_url()}/voices/clone/clip"
|
74
|
+
with open(filepath, "rb") as file:
|
75
|
+
files = {"clip": file}
|
76
|
+
files["enhance"] = str(enhance).lower()
|
77
|
+
headers = self.headers.copy()
|
78
|
+
headers.pop("Content-Type", None)
|
79
|
+
response = httpx.post(url, headers=headers, files=files, timeout=self.timeout)
|
80
|
+
if not response.is_success:
|
81
|
+
raise ValueError(f"Failed to clone voice from clip. Error: {response.text}")
|
82
|
+
|
83
|
+
return response.json()["embedding"]
|
84
|
+
|
85
|
+
def create(
|
86
|
+
self,
|
87
|
+
name: str,
|
88
|
+
description: str,
|
89
|
+
embedding: List[float],
|
90
|
+
base_voice_id: Optional[str] = None,
|
91
|
+
) -> VoiceMetadata:
|
92
|
+
"""Create a new voice.
|
93
|
+
|
94
|
+
Args:
|
95
|
+
name: The name of the voice.
|
96
|
+
description: The description of the voice.
|
97
|
+
embedding: The embedding of the voice. This should be generated with :meth:`clone`.
|
98
|
+
base_voice_id: The ID of the base voice. This should be a valid voice ID if specified.
|
99
|
+
|
100
|
+
Returns:
|
101
|
+
A dictionary containing the voice metadata.
|
102
|
+
"""
|
103
|
+
response = httpx.post(
|
104
|
+
f"{self._http_url()}/voices",
|
105
|
+
headers=self.headers,
|
106
|
+
json={
|
107
|
+
"name": name,
|
108
|
+
"description": description,
|
109
|
+
"embedding": embedding,
|
110
|
+
"base_voice_id": base_voice_id,
|
111
|
+
},
|
112
|
+
timeout=self.timeout,
|
113
|
+
)
|
114
|
+
|
115
|
+
if not response.is_success:
|
116
|
+
raise ValueError(f"Failed to create voice. Error: {response.text}")
|
117
|
+
|
118
|
+
return response.json()
|
119
|
+
|
120
|
+
def delete(self, id: str) -> bool:
|
121
|
+
"""Delete a voice by its ID.
|
122
|
+
|
123
|
+
Args:
|
124
|
+
id: The ID of the voice.
|
125
|
+
|
126
|
+
Raises:
|
127
|
+
ValueError: If the request fails.
|
128
|
+
"""
|
129
|
+
response = httpx.delete(
|
130
|
+
f"{self._http_url()}/voices/{id}",
|
131
|
+
headers=self.headers,
|
132
|
+
timeout=self.timeout,
|
133
|
+
)
|
134
|
+
|
135
|
+
if not response.is_success:
|
136
|
+
raise ValueError(f"Failed to delete voice. Error: {response.text}")
|
137
|
+
|
138
|
+
def mix(self, voices: List[Dict[str, Union[str, float]]]) -> List[float]:
|
139
|
+
"""Mix multiple voices together.
|
140
|
+
|
141
|
+
Args:
|
142
|
+
voices: A list of dictionaries, each containing either:
|
143
|
+
- 'id': The ID of an existing voice
|
144
|
+
- 'embedding': A voice embedding
|
145
|
+
AND
|
146
|
+
- 'weight': The weight of the voice in the mix (0.0 to 1.0)
|
147
|
+
|
148
|
+
Returns:
|
149
|
+
The embedding of the mixed voice as a list of floats.
|
150
|
+
|
151
|
+
Raises:
|
152
|
+
ValueError: If the request fails or if the input is invalid.
|
153
|
+
"""
|
154
|
+
url = f"{self._http_url()}/voices/mix"
|
155
|
+
|
156
|
+
if not voices or not isinstance(voices, list):
|
157
|
+
raise ValueError("voices must be a non-empty list")
|
158
|
+
|
159
|
+
response = httpx.post(
|
160
|
+
url,
|
161
|
+
headers=self.headers,
|
162
|
+
json={"voices": voices},
|
163
|
+
timeout=self.timeout,
|
164
|
+
)
|
165
|
+
|
166
|
+
if not response.is_success:
|
167
|
+
raise ValueError(f"Failed to mix voices. Error: {response.text}")
|
168
|
+
|
169
|
+
result = response.json()
|
170
|
+
return result["embedding"]
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: cartesia
|
3
|
-
Version: 1.0.
|
3
|
+
Version: 1.0.14
|
4
4
|
Summary: The official Python library for the Cartesia API.
|
5
5
|
Home-page:
|
6
6
|
Author: Cartesia, Inc.
|
@@ -24,6 +24,8 @@ Requires-Dist: twine; extra == "all"
|
|
24
24
|
Requires-Dist: setuptools; extra == "all"
|
25
25
|
Requires-Dist: wheel; extra == "all"
|
26
26
|
Requires-Dist: numpy; extra == "all"
|
27
|
+
Requires-Dist: isort; extra == "all"
|
28
|
+
Requires-Dist: ruff; extra == "all"
|
27
29
|
Provides-Extra: dev
|
28
30
|
Requires-Dist: pytest>=8.0.2; extra == "dev"
|
29
31
|
Requires-Dist: pytest-cov>=4.1.0; extra == "dev"
|
@@ -31,17 +33,19 @@ Requires-Dist: twine; extra == "dev"
|
|
31
33
|
Requires-Dist: setuptools; extra == "dev"
|
32
34
|
Requires-Dist: wheel; extra == "dev"
|
33
35
|
Requires-Dist: numpy; extra == "dev"
|
36
|
+
Requires-Dist: isort; extra == "dev"
|
37
|
+
Requires-Dist: ruff; extra == "dev"
|
34
38
|
|
35
39
|
|
36
40
|
# Cartesia Python API Library
|
37
41
|
|
38
42
|

|
39
|
-
[](https://discord.gg/
|
43
|
+
[](https://discord.gg/cartesia)
|
40
44
|
|
41
45
|
The official Cartesia Python library which provides convenient access to the Cartesia REST and Websocket API from any Python 3.8+ application.
|
42
46
|
|
43
47
|
> [!IMPORTANT]
|
44
|
-
> The client library introduces breaking changes in v1.0.0, which was released on June 24th 2024. See the [release notes](https://github.com/cartesia-ai/cartesia-python/releases/tag/v1.0.0) and [migration guide](https://github.com/cartesia-ai/cartesia-python/discussions/44). Reach out to us on [Discord](https://discord.gg/
|
48
|
+
> The client library introduces breaking changes in v1.0.0, which was released on June 24th 2024. See the [release notes](https://github.com/cartesia-ai/cartesia-python/releases/tag/v1.0.0) and [migration guide](https://github.com/cartesia-ai/cartesia-python/discussions/44). Reach out to us on [Discord](https://discord.gg/cartesia) for any support requests!
|
45
49
|
|
46
50
|
- [Cartesia Python API Library](#cartesia-python-api-library)
|
47
51
|
- [Documentation](#documentation)
|
@@ -123,7 +127,7 @@ transcript = "Hello! Welcome to Cartesia"
|
|
123
127
|
# You can check out our models at https://docs.cartesia.ai/getting-started/available-models
|
124
128
|
model_id = "sonic-english"
|
125
129
|
|
126
|
-
# You can find the supported `output_format`s at https://docs.cartesia.ai/api-reference/
|
130
|
+
# You can find the supported `output_format`s at https://docs.cartesia.ai/reference/api-reference/rest/stream-speech-server-sent-events
|
127
131
|
output_format = {
|
128
132
|
"container": "raw",
|
129
133
|
"encoding": "pcm_f32le",
|
@@ -174,7 +178,7 @@ async def write_stream():
|
|
174
178
|
# You can check out our models at https://docs.cartesia.ai/getting-started/available-models
|
175
179
|
model_id = "sonic-english"
|
176
180
|
|
177
|
-
# You can find the supported `output_format`s at https://docs.cartesia.ai/api-reference/
|
181
|
+
# You can find the supported `output_format`s at https://docs.cartesia.ai/reference/api-reference/rest/stream-speech-server-sent-events
|
178
182
|
output_format = {
|
179
183
|
"container": "raw",
|
180
184
|
"encoding": "pcm_f32le",
|
@@ -229,7 +233,7 @@ transcript = "Hello! Welcome to Cartesia"
|
|
229
233
|
# You can check out our models at https://docs.cartesia.ai/getting-started/available-models
|
230
234
|
model_id = "sonic-english"
|
231
235
|
|
232
|
-
# You can find the supported `output_format`s at https://docs.cartesia.ai/api-reference/
|
236
|
+
# You can find the supported `output_format`s at https://docs.cartesia.ai/reference/api-reference/rest/stream-speech-server-sent-events
|
233
237
|
output_format = {
|
234
238
|
"container": "raw",
|
235
239
|
"encoding": "pcm_f32le",
|
@@ -290,7 +294,7 @@ async def send_transcripts(ctx):
|
|
290
294
|
# You can check out our models at https://docs.cartesia.ai/getting-started/available-models
|
291
295
|
model_id = "sonic-english"
|
292
296
|
|
293
|
-
# You can find the supported `output_format`s at https://docs.cartesia.ai/api-reference/
|
297
|
+
# You can find the supported `output_format`s at https://docs.cartesia.ai/reference/api-reference/rest/stream-speech-server-sent-events
|
294
298
|
output_format = {
|
295
299
|
"container": "raw",
|
296
300
|
"encoding": "pcm_f32le",
|
@@ -398,7 +402,7 @@ voice_id = "87748186-23bb-4158-a1eb-332911b0b708"
|
|
398
402
|
# You can check out our models at https://docs.cartesia.ai/getting-started/available-models
|
399
403
|
model_id = "sonic-english"
|
400
404
|
|
401
|
-
# You can find the supported `output_format`s at https://docs.cartesia.ai/api-reference/
|
405
|
+
# You can find the supported `output_format`s at https://docs.cartesia.ai/reference/api-reference/rest/stream-speech-server-sent-events
|
402
406
|
output_format = {
|
403
407
|
"container": "raw",
|
404
408
|
"encoding": "pcm_f32le",
|
@@ -488,7 +492,7 @@ language = "es" # Language code corresponding to the language of the transcript
|
|
488
492
|
# Make sure you use the multilingual model! You can check out all models at https://docs.cartesia.ai/getting-started/available-models
|
489
493
|
model_id = "sonic-multilingual"
|
490
494
|
|
491
|
-
# You can find the supported `output_format`s at https://docs.cartesia.ai/api-reference/
|
495
|
+
# You can find the supported `output_format`s at https://docs.cartesia.ai/reference/api-reference/rest/stream-speech-server-sent-events
|
492
496
|
output_format = {
|
493
497
|
"container": "raw",
|
494
498
|
"encoding": "pcm_f32le",
|
@@ -641,7 +645,7 @@ display(audio)
|
|
641
645
|
|
642
646
|
#### Output Formats
|
643
647
|
|
644
|
-
You can use the `client.tts.get_output_format` method to convert string-based output format names into the `output_format` dictionary which is expected by the `output_format` parameter. You can see the `OutputFormatMapping` class in `cartesia._types` for the currently supported output format names. You can also view the currently supported `output_format`s in our [API Reference](https://docs.cartesia.ai/api-reference/
|
648
|
+
You can use the `client.tts.get_output_format` method to convert string-based output format names into the `output_format` dictionary which is expected by the `output_format` parameter. You can see the `OutputFormatMapping` class in `cartesia._types` for the currently supported output format names. You can also view the currently supported `output_format`s in our [API Reference](https://docs.cartesia.ai/reference/api-reference/rest/stream-speech-server-sent-events).
|
645
649
|
|
646
650
|
The previously used `output_format` strings are now deprecated and will be removed in v1.2.0. These are listed in the `DeprecatedOutputFormatMapping` class in `cartesia._types`.
|
647
651
|
|
@@ -0,0 +1,24 @@
|
|
1
|
+
cartesia/__init__.py,sha256=rS7jIg4iqT0VgnwjzYK25JXxnF5hjZGE_-PGynAqHFo,126
|
2
|
+
cartesia/_async_sse.py,sha256=syfGJvQD6JEzqA2thuk9CY91gzWz1FJwJdwaE1dhffQ,3598
|
3
|
+
cartesia/_async_websocket.py,sha256=8ZfSLHbaMQS25AEHOboqiAd9ttNN0zxyZ74PiMCR9B0,12756
|
4
|
+
cartesia/_constants.py,sha256=lquaYIg7IThdmC1fCklnWC8EM7stbSeVCDwRqCzPq-U,389
|
5
|
+
cartesia/_logger.py,sha256=vU7QiGSy_AJuJFmClUocqIJ-Ltku_8C24ZU8L6fLJR0,53
|
6
|
+
cartesia/_sse.py,sha256=C4oG17t1G_sI1oTyESPxhlvPA99gCra1C-TyhvS3BZ0,5934
|
7
|
+
cartesia/_types.py,sha256=2fTSCwjL9lJ3jsdbs0P9fHsjkhejyrrYt6oqIXGk1y4,4488
|
8
|
+
cartesia/_websocket.py,sha256=moHoX4WDslXBwbdi8dJcS2RjGkemH73EjMNO42uYGdg,15300
|
9
|
+
cartesia/async_client.py,sha256=y_K_Yuv0weA4k9ZYD0M9bNM3x3frsq07tqkg7R9h0-o,2714
|
10
|
+
cartesia/async_tts.py,sha256=OhADdUngrB3XhOirOwX3SmLBFGZakicOUGD61FqGXRo,723
|
11
|
+
cartesia/client.py,sha256=OS1ORUSlR8Jg-em1imeTAFfwkC85AQFnw8PYtTdUuC8,2364
|
12
|
+
cartesia/resource.py,sha256=wpnB3IPcTdxYSp0vxSkpntp4NSvqvnwUWF-0ZpgWV9o,1585
|
13
|
+
cartesia/tts.py,sha256=P-lFTgyNtU4VRdpxAdGfPjIlL4hWp6w3Pc-qf61dzoA,4199
|
14
|
+
cartesia/version.py,sha256=tmJFcbWnlgNwXFCrgJHkNSJZmxR67rAjso_lz91m_vc,23
|
15
|
+
cartesia/voices.py,sha256=DB4tEiSJp7jfnQM0HoiSFS09ZY2oAFbOwMlKe6pofTs,5606
|
16
|
+
cartesia/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
17
|
+
cartesia/utils/deprecated.py,sha256=2cXvGtrxhPeUZA5LWy2n_U5OFLDv7SHeFtzqhjSJGyk,1674
|
18
|
+
cartesia/utils/retry.py,sha256=O6fyVWpH9Su8c0Fwupl57xMt6JrwJ52txBwP3faUL7k,3339
|
19
|
+
cartesia/utils/tts.py,sha256=d32Yqye-dyP1Bgt6djVOkKeb6aETDZ3VqTNMvfIMolU,709
|
20
|
+
cartesia-1.0.14.dist-info/LICENSE.md,sha256=PT2YG5wEtEX1TNDn5sXkUXqbn-neyr7cZenTxd40ql4,1074
|
21
|
+
cartesia-1.0.14.dist-info/METADATA,sha256=nb0aVbVjwWDefgmQAXUeEX6dFmXfa71ZvBeWwih6MBQ,21590
|
22
|
+
cartesia-1.0.14.dist-info/WHEEL,sha256=fS9sRbCBHs7VFcwJLnLXN1MZRR0_TVTxvXKzOnaSFs8,110
|
23
|
+
cartesia-1.0.14.dist-info/top_level.txt,sha256=rTX4HnnCegMxl1FK9czpVC7GAvf3SwDzPG65qP-BS4w,9
|
24
|
+
cartesia-1.0.14.dist-info/RECORD,,
|
cartesia-1.0.12.dist-info/RECORD
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
cartesia/__init__.py,sha256=E4w7psbAwx8X6Iri3W8jGeo11gIlhr3mSU33zChipmI,93
|
2
|
-
cartesia/_types.py,sha256=pkFJmsO-OWAJNtqxV80-YcR8KWWLhIwLFejzDjBewbw,4428
|
3
|
-
cartesia/client.py,sha256=bYUk-P7QlPNNDhQaI5fldkDZAC8vVVUuHrgRHOq_V78,52818
|
4
|
-
cartesia/version.py,sha256=bQ8TKIXU3qSGr-K-gVtWDgjDfBlCgBju76OGKtY9tS8,23
|
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=O6fyVWpH9Su8c0Fwupl57xMt6JrwJ52txBwP3faUL7k,3339
|
8
|
-
cartesia-1.0.12.dist-info/LICENSE.md,sha256=PT2YG5wEtEX1TNDn5sXkUXqbn-neyr7cZenTxd40ql4,1074
|
9
|
-
cartesia-1.0.12.dist-info/METADATA,sha256=3jeDZosoKAHVx9hcLjE9iZsggAvpR_L2iX3hnP_UFd4,21413
|
10
|
-
cartesia-1.0.12.dist-info/WHEEL,sha256=fS9sRbCBHs7VFcwJLnLXN1MZRR0_TVTxvXKzOnaSFs8,110
|
11
|
-
cartesia-1.0.12.dist-info/top_level.txt,sha256=rTX4HnnCegMxl1FK9czpVC7GAvf3SwDzPG65qP-BS4w,9
|
12
|
-
cartesia-1.0.12.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|