cartesia 0.1.0__py2.py3-none-any.whl → 0.1.1__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/_types.py +1 -0
- cartesia/tts.py +2 -1
- cartesia/version.py +1 -1
- {cartesia-0.1.0.dist-info → cartesia-0.1.1.dist-info}/METADATA +5 -5
- cartesia-0.1.1.dist-info/RECORD +9 -0
- cartesia-0.1.0.dist-info/RECORD +0 -9
- {cartesia-0.1.0.dist-info → cartesia-0.1.1.dist-info}/WHEEL +0 -0
- {cartesia-0.1.0.dist-info → cartesia-0.1.1.dist-info}/top_level.txt +0 -0
cartesia/_types.py
CHANGED
@@ -25,6 +25,7 @@ class AudioOutputFormat(Enum):
|
|
25
25
|
PCM_16000 = "pcm_16000" # 16-bit signed integer PCM, 16 kHz
|
26
26
|
PCM_22050 = "pcm_22050" # 16-bit signed integer PCM, 22.05 kHz
|
27
27
|
PCM_44100 = "pcm_44100" # 16-bit signed integer PCM, 44.1 kHz
|
28
|
+
MULAW_8000 = "mulaw_8000" # 8-bit mu-law, 8 kHz
|
28
29
|
|
29
30
|
|
30
31
|
class AudioOutput(TypedDict):
|
cartesia/tts.py
CHANGED
@@ -671,7 +671,8 @@ class AsyncCartesiaTTS(CartesiaTTS):
|
|
671
671
|
except Exception as e:
|
672
672
|
if self.websocket and not self._is_websocket_closed():
|
673
673
|
await self.websocket.close()
|
674
|
-
|
674
|
+
error_msg_end = "" if response is None else f": {await response.text()}"
|
675
|
+
raise RuntimeError(f"Failed to generate audio{error_msg_end}") from e
|
675
676
|
finally:
|
676
677
|
# Ensure the websocket is ultimately closed.
|
677
678
|
if self.websocket and not self._is_websocket_closed():
|
cartesia/version.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
__version__ = "0.1.
|
1
|
+
__version__ = "0.1.1"
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: cartesia
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.1
|
4
4
|
Summary: The official Python library for the Cartesia API.
|
5
5
|
Home-page:
|
6
6
|
Author: Cartesia, Inc.
|
@@ -52,7 +52,7 @@ import os
|
|
52
52
|
|
53
53
|
client = CartesiaTTS(api_key=os.environ.get("CARTESIA_API_KEY"))
|
54
54
|
voices = client.get_voices()
|
55
|
-
voice = client.get_voice_embedding(voice_id=voices["
|
55
|
+
voice = client.get_voice_embedding(voice_id=voices["Ted"]["id"])
|
56
56
|
transcript = "Hello! Welcome to Cartesia"
|
57
57
|
model_id = "genial-planet-1346" # (Optional) We'll specify a default if you don't have a specific model in mind
|
58
58
|
|
@@ -89,7 +89,7 @@ import os
|
|
89
89
|
async def write_stream():
|
90
90
|
client = AsyncCartesiaTTS(api_key=os.environ.get("CARTESIA_API_KEY"))
|
91
91
|
voices = client.get_voices()
|
92
|
-
voice = client.get_voice_embedding(voice_id=voices["
|
92
|
+
voice = client.get_voice_embedding(voice_id=voices["Ted"]["id"])
|
93
93
|
transcript = "Hello! Welcome to Cartesia"
|
94
94
|
model_id = "genial-planet-1346" # (Optional) We'll specify a default if you don't have a specific model in mind
|
95
95
|
|
@@ -131,7 +131,7 @@ from cartesia.tts import CartesiaTTS
|
|
131
131
|
|
132
132
|
with CartesiaTTS(api_key=os.environ.get("CARTESIA_API_KEY")) as client:
|
133
133
|
voices = client.get_voices()
|
134
|
-
voice = client.get_voice_embedding(voice_id=voices["
|
134
|
+
voice = client.get_voice_embedding(voice_id=voices["Ted"]["id"])
|
135
135
|
transcript = "Hello! Welcome to Cartesia"
|
136
136
|
|
137
137
|
# Create a BytesIO object to store the audio data
|
@@ -163,7 +163,7 @@ from cartesia.tts import AsyncCartesiaTTS
|
|
163
163
|
|
164
164
|
async with AsyncCartesiaTTS(api_key=os.environ.get("CARTESIA_API_KEY")) as client:
|
165
165
|
voices = client.get_voices()
|
166
|
-
voice = client.get_voice_embedding(voice_id=voices["
|
166
|
+
voice = client.get_voice_embedding(voice_id=voices["Ted"]["id"])
|
167
167
|
transcript = "Hello! Welcome to Cartesia"
|
168
168
|
|
169
169
|
# Create a BytesIO object to store the audio data
|
@@ -0,0 +1,9 @@
|
|
1
|
+
cartesia/__init__.py,sha256=uIc9xGNPs8_A6eAvbTUY1geazunYoEZVWFKhCwC9TRA,102
|
2
|
+
cartesia/_types.py,sha256=602535A2Qpk-546dxRNPj3uvznJmBQcOa4Kkv0nSQKQ,1054
|
3
|
+
cartesia/tts.py,sha256=vCrcBqkFCmmv16uNPlzqmARNLdKUN6XC2yxwEuxdOHc,25881
|
4
|
+
cartesia/utils.py,sha256=nuwWRfu3MOVTxIQMLjYf6WLaxSlnu_GdE3QjTV0zisQ,3339
|
5
|
+
cartesia/version.py,sha256=rnObPjuBcEStqSO0S6gsdS_ot8ITOQjVj_-P1LUUYpg,22
|
6
|
+
cartesia-0.1.1.dist-info/METADATA,sha256=VLtJRjJPczIafLgiHMjpNf3c4lkMArXf6FlLAa1ojm8,6038
|
7
|
+
cartesia-0.1.1.dist-info/WHEEL,sha256=DZajD4pwLWue70CAfc7YaxT1wLUciNBvN_TTcvXpltE,110
|
8
|
+
cartesia-0.1.1.dist-info/top_level.txt,sha256=rTX4HnnCegMxl1FK9czpVC7GAvf3SwDzPG65qP-BS4w,9
|
9
|
+
cartesia-0.1.1.dist-info/RECORD,,
|
cartesia-0.1.0.dist-info/RECORD
DELETED
@@ -1,9 +0,0 @@
|
|
1
|
-
cartesia/__init__.py,sha256=uIc9xGNPs8_A6eAvbTUY1geazunYoEZVWFKhCwC9TRA,102
|
2
|
-
cartesia/_types.py,sha256=uf2Pe-9g7nU-RNUxNAFN3j5Cwy0WyLP1oZf6VV5rGgw,1001
|
3
|
-
cartesia/tts.py,sha256=hAADPdTYu7yGsY7yIQIf1hjKKJLUk9pm5LU0cEIB8gA,25806
|
4
|
-
cartesia/utils.py,sha256=nuwWRfu3MOVTxIQMLjYf6WLaxSlnu_GdE3QjTV0zisQ,3339
|
5
|
-
cartesia/version.py,sha256=kUR5RAFc7HCeiqdlX36dZOHkUI5wI6V_43RpEcD8b-0,22
|
6
|
-
cartesia-0.1.0.dist-info/METADATA,sha256=H7spLdviK35R839_OAB47JL2FAaGw6AZ7CnNs_xy87Q,6050
|
7
|
-
cartesia-0.1.0.dist-info/WHEEL,sha256=DZajD4pwLWue70CAfc7YaxT1wLUciNBvN_TTcvXpltE,110
|
8
|
-
cartesia-0.1.0.dist-info/top_level.txt,sha256=rTX4HnnCegMxl1FK9czpVC7GAvf3SwDzPG65qP-BS4w,9
|
9
|
-
cartesia-0.1.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|