typecast-python 0.3.14__py3-none-any.whl → 0.3.15__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.
- typecast/models/tts.py +22 -2
- {typecast_python-0.3.14.dist-info → typecast_python-0.3.15.dist-info}/METADATA +4 -4
- {typecast_python-0.3.14.dist-info → typecast_python-0.3.15.dist-info}/RECORD +5 -5
- {typecast_python-0.3.14.dist-info → typecast_python-0.3.15.dist-info}/WHEEL +0 -0
- {typecast_python-0.3.14.dist-info → typecast_python-0.3.15.dist-info}/licenses/LICENSE +0 -0
typecast/models/tts.py
CHANGED
|
@@ -124,6 +124,13 @@ TTSPrompt = Union[Prompt, PresetPrompt, SmartPrompt]
|
|
|
124
124
|
|
|
125
125
|
|
|
126
126
|
class Output(BaseModel):
|
|
127
|
+
remove_silence_ms: Optional[int] = Field(
|
|
128
|
+
default=None,
|
|
129
|
+
strict=True,
|
|
130
|
+
ge=0,
|
|
131
|
+
le=1000,
|
|
132
|
+
description="Remaining detected silence in milliseconds. 0 removes silence; None disables this processing.",
|
|
133
|
+
)
|
|
127
134
|
volume: Optional[int] = Field(
|
|
128
135
|
default=100,
|
|
129
136
|
ge=0,
|
|
@@ -191,6 +198,14 @@ class OutputStream(BaseModel):
|
|
|
191
198
|
|
|
192
199
|
model_config = ConfigDict(extra="forbid")
|
|
193
200
|
|
|
201
|
+
remove_silence_ms: Optional[int] = Field(
|
|
202
|
+
default=None,
|
|
203
|
+
strict=True,
|
|
204
|
+
ge=0,
|
|
205
|
+
le=1000,
|
|
206
|
+
description="Remaining detected silence in milliseconds. 0 removes silence; None disables this processing.",
|
|
207
|
+
)
|
|
208
|
+
|
|
194
209
|
audio_pitch: Optional[int] = Field(default=0, ge=-12, le=12)
|
|
195
210
|
audio_tempo: Optional[float] = Field(default=1.0, ge=0.5, le=2.0)
|
|
196
211
|
audio_format: Optional[str] = Field(
|
|
@@ -419,6 +434,7 @@ class TTSWithTimestampsResponse(BaseModel):
|
|
|
419
434
|
def audio_bytes(self) -> bytes:
|
|
420
435
|
"""Return decoded audio bytes from the base64 `audio` field."""
|
|
421
436
|
import base64
|
|
437
|
+
|
|
422
438
|
return base64.b64decode(self.audio, validate=True)
|
|
423
439
|
|
|
424
440
|
def save_audio(self, path: str) -> None:
|
|
@@ -436,7 +452,9 @@ class TTSWithTimestampsResponse(BaseModel):
|
|
|
436
452
|
subtitle guidelines (7.0s / 42 chars).
|
|
437
453
|
"""
|
|
438
454
|
segments, word_mode = _segments_for_captioning(self.words, self.characters)
|
|
439
|
-
cues = _group_into_cues(
|
|
455
|
+
cues = _group_into_cues(
|
|
456
|
+
segments, word_mode=word_mode, max_seconds=max_seconds, max_chars=max_chars
|
|
457
|
+
)
|
|
440
458
|
if not cues:
|
|
441
459
|
raise ValueError("no alignment segments to caption from")
|
|
442
460
|
lines = []
|
|
@@ -457,7 +475,9 @@ class TTSWithTimestampsResponse(BaseModel):
|
|
|
457
475
|
subtitle guidelines (7.0s / 42 chars).
|
|
458
476
|
"""
|
|
459
477
|
segments, word_mode = _segments_for_captioning(self.words, self.characters)
|
|
460
|
-
cues = _group_into_cues(
|
|
478
|
+
cues = _group_into_cues(
|
|
479
|
+
segments, word_mode=word_mode, max_seconds=max_seconds, max_chars=max_chars
|
|
480
|
+
)
|
|
461
481
|
if not cues:
|
|
462
482
|
raise ValueError("no alignment segments to caption from")
|
|
463
483
|
lines = ["WEBVTT", ""]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: typecast-python
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.15
|
|
4
4
|
Summary: Official Typecast Python SDK - Convert text to lifelike speech using AI-powered voices
|
|
5
5
|
Project-URL: Homepage, https://typecast.ai
|
|
6
6
|
Project-URL: Documentation, https://typecast.ai/docs/overview
|
|
@@ -383,11 +383,11 @@ response = client.text_to_speech(TTSRequest(
|
|
|
383
383
|
```python
|
|
384
384
|
from typecast.models import VoicesV2Filter, TTSModel, GenderEnum, AgeEnum
|
|
385
385
|
|
|
386
|
-
# Get all voices (
|
|
387
|
-
voices = client.
|
|
386
|
+
# Get all voices (V3 API)
|
|
387
|
+
voices = client.voices_v3()
|
|
388
388
|
|
|
389
389
|
# Filter by criteria
|
|
390
|
-
filtered = client.
|
|
390
|
+
filtered = client.voices_v3(VoicesV2Filter(
|
|
391
391
|
model=TTSModel.SSFM_V30,
|
|
392
392
|
gender=GenderEnum.FEMALE,
|
|
393
393
|
age=AgeEnum.YOUNG_ADULT
|
|
@@ -11,9 +11,9 @@ typecast/utils.py,sha256=XuNuX7gW8_CGKqZ-cv_tKlPVMPBluAYJBw2clwmjIMI,708
|
|
|
11
11
|
typecast/models/__init__.py,sha256=JRvzNxlYFGF4T0Mze2jYLiTXRzRqFczs0hP7j3izrMM,1343
|
|
12
12
|
typecast/models/error.py,sha256=XomIjx7jvlCjItqzJuCAT4mXC9jwTjxR8lLDUk6P8KA,152
|
|
13
13
|
typecast/models/subscription.py,sha256=pUn8_GB_03Na0eKFCzgsTkOEs5WTFu-lAdv3NYYxX94,1049
|
|
14
|
-
typecast/models/tts.py,sha256=
|
|
14
|
+
typecast/models/tts.py,sha256=ejwBwJvwfwu-X4SJD1WEO2XjOmG6jcu7_gxgxyoMiGs,17027
|
|
15
15
|
typecast/models/voices.py,sha256=L3MmlVz468_iv8t25TOAWlpQrcB9L8Wh9LGfA7sXcnc,3531
|
|
16
|
-
typecast_python-0.3.
|
|
17
|
-
typecast_python-0.3.
|
|
18
|
-
typecast_python-0.3.
|
|
19
|
-
typecast_python-0.3.
|
|
16
|
+
typecast_python-0.3.15.dist-info/METADATA,sha256=aX5o05wOLVOEpyilz50eO0NIWkaZx-I8H3-MAslX3Vc,25933
|
|
17
|
+
typecast_python-0.3.15.dist-info/WHEEL,sha256=zOwg4jB6zX2kU910N-cMawjivD6tO8NEWvE12je1bVk,87
|
|
18
|
+
typecast_python-0.3.15.dist-info/licenses/LICENSE,sha256=HvtJ-S89uUkuYmt-OvVk4MRxmzwtbn84__qJtSrGU2Q,11348
|
|
19
|
+
typecast_python-0.3.15.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|