cartesia 0.1.0__tar.gz → 0.1.1__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cartesia
3
- Version: 0.1.0
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.
@@ -35,7 +35,7 @@ import os
35
35
 
36
36
  client = CartesiaTTS(api_key=os.environ.get("CARTESIA_API_KEY"))
37
37
  voices = client.get_voices()
38
- voice = client.get_voice_embedding(voice_id=voices["Graham"]["id"])
38
+ voice = client.get_voice_embedding(voice_id=voices["Ted"]["id"])
39
39
  transcript = "Hello! Welcome to Cartesia"
40
40
  model_id = "genial-planet-1346" # (Optional) We'll specify a default if you don't have a specific model in mind
41
41
 
@@ -72,7 +72,7 @@ import os
72
72
  async def write_stream():
73
73
  client = AsyncCartesiaTTS(api_key=os.environ.get("CARTESIA_API_KEY"))
74
74
  voices = client.get_voices()
75
- voice = client.get_voice_embedding(voice_id=voices["Graham"]["id"])
75
+ voice = client.get_voice_embedding(voice_id=voices["Ted"]["id"])
76
76
  transcript = "Hello! Welcome to Cartesia"
77
77
  model_id = "genial-planet-1346" # (Optional) We'll specify a default if you don't have a specific model in mind
78
78
 
@@ -114,7 +114,7 @@ from cartesia.tts import CartesiaTTS
114
114
 
115
115
  with CartesiaTTS(api_key=os.environ.get("CARTESIA_API_KEY")) as client:
116
116
  voices = client.get_voices()
117
- voice = client.get_voice_embedding(voice_id=voices["Graham"]["id"])
117
+ voice = client.get_voice_embedding(voice_id=voices["Ted"]["id"])
118
118
  transcript = "Hello! Welcome to Cartesia"
119
119
 
120
120
  # Create a BytesIO object to store the audio data
@@ -146,7 +146,7 @@ from cartesia.tts import AsyncCartesiaTTS
146
146
 
147
147
  async with AsyncCartesiaTTS(api_key=os.environ.get("CARTESIA_API_KEY")) as client:
148
148
  voices = client.get_voices()
149
- voice = client.get_voice_embedding(voice_id=voices["Graham"]["id"])
149
+ voice = client.get_voice_embedding(voice_id=voices["Ted"]["id"])
150
150
  transcript = "Hello! Welcome to Cartesia"
151
151
 
152
152
  # Create a BytesIO object to store the audio data
@@ -19,7 +19,7 @@ import os
19
19
 
20
20
  client = CartesiaTTS(api_key=os.environ.get("CARTESIA_API_KEY"))
21
21
  voices = client.get_voices()
22
- voice = client.get_voice_embedding(voice_id=voices["Graham"]["id"])
22
+ voice = client.get_voice_embedding(voice_id=voices["Ted"]["id"])
23
23
  transcript = "Hello! Welcome to Cartesia"
24
24
  model_id = "genial-planet-1346" # (Optional) We'll specify a default if you don't have a specific model in mind
25
25
 
@@ -56,7 +56,7 @@ import os
56
56
  async def write_stream():
57
57
  client = AsyncCartesiaTTS(api_key=os.environ.get("CARTESIA_API_KEY"))
58
58
  voices = client.get_voices()
59
- voice = client.get_voice_embedding(voice_id=voices["Graham"]["id"])
59
+ voice = client.get_voice_embedding(voice_id=voices["Ted"]["id"])
60
60
  transcript = "Hello! Welcome to Cartesia"
61
61
  model_id = "genial-planet-1346" # (Optional) We'll specify a default if you don't have a specific model in mind
62
62
 
@@ -98,7 +98,7 @@ from cartesia.tts import CartesiaTTS
98
98
 
99
99
  with CartesiaTTS(api_key=os.environ.get("CARTESIA_API_KEY")) as client:
100
100
  voices = client.get_voices()
101
- voice = client.get_voice_embedding(voice_id=voices["Graham"]["id"])
101
+ voice = client.get_voice_embedding(voice_id=voices["Ted"]["id"])
102
102
  transcript = "Hello! Welcome to Cartesia"
103
103
 
104
104
  # Create a BytesIO object to store the audio data
@@ -130,7 +130,7 @@ from cartesia.tts import AsyncCartesiaTTS
130
130
 
131
131
  async with AsyncCartesiaTTS(api_key=os.environ.get("CARTESIA_API_KEY")) as client:
132
132
  voices = client.get_voices()
133
- voice = client.get_voice_embedding(voice_id=voices["Graham"]["id"])
133
+ voice = client.get_voice_embedding(voice_id=voices["Ted"]["id"])
134
134
  transcript = "Hello! Welcome to Cartesia"
135
135
 
136
136
  # Create a BytesIO object to store the audio data
@@ -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):
@@ -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
- raise RuntimeError(f"Failed to generate audio. {await response.text()}") from e
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():
@@ -0,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.0
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.
@@ -35,7 +35,7 @@ import os
35
35
 
36
36
  client = CartesiaTTS(api_key=os.environ.get("CARTESIA_API_KEY"))
37
37
  voices = client.get_voices()
38
- voice = client.get_voice_embedding(voice_id=voices["Graham"]["id"])
38
+ voice = client.get_voice_embedding(voice_id=voices["Ted"]["id"])
39
39
  transcript = "Hello! Welcome to Cartesia"
40
40
  model_id = "genial-planet-1346" # (Optional) We'll specify a default if you don't have a specific model in mind
41
41
 
@@ -72,7 +72,7 @@ import os
72
72
  async def write_stream():
73
73
  client = AsyncCartesiaTTS(api_key=os.environ.get("CARTESIA_API_KEY"))
74
74
  voices = client.get_voices()
75
- voice = client.get_voice_embedding(voice_id=voices["Graham"]["id"])
75
+ voice = client.get_voice_embedding(voice_id=voices["Ted"]["id"])
76
76
  transcript = "Hello! Welcome to Cartesia"
77
77
  model_id = "genial-planet-1346" # (Optional) We'll specify a default if you don't have a specific model in mind
78
78
 
@@ -114,7 +114,7 @@ from cartesia.tts import CartesiaTTS
114
114
 
115
115
  with CartesiaTTS(api_key=os.environ.get("CARTESIA_API_KEY")) as client:
116
116
  voices = client.get_voices()
117
- voice = client.get_voice_embedding(voice_id=voices["Graham"]["id"])
117
+ voice = client.get_voice_embedding(voice_id=voices["Ted"]["id"])
118
118
  transcript = "Hello! Welcome to Cartesia"
119
119
 
120
120
  # Create a BytesIO object to store the audio data
@@ -146,7 +146,7 @@ from cartesia.tts import AsyncCartesiaTTS
146
146
 
147
147
  async with AsyncCartesiaTTS(api_key=os.environ.get("CARTESIA_API_KEY")) as client:
148
148
  voices = client.get_voices()
149
- voice = client.get_voice_embedding(voice_id=voices["Graham"]["id"])
149
+ voice = client.get_voice_embedding(voice_id=voices["Ted"]["id"])
150
150
  transcript = "Hello! Welcome to Cartesia"
151
151
 
152
152
  # Create a BytesIO object to store the audio data
@@ -1 +0,0 @@
1
- __version__ = "0.1.0"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes