Official Python SDK for CronyGen Text-to-Speech API
Project description
CronyGen Python SDK
Official Python SDK for the CronyGen Text-to-Speech API.
Installation
pip install cronygen
Quick Start
from cronygen import CronyGen
# Initialize client
client = CronyGen(api_key="crony_sk_your_api_key")
# Generate TTS with a default voice
generation = client.tts.generate(
text="Hello world! This is a test of CronyGen text-to-speech.",
voice="en-us-aria"
)
# Download the audio
client.tts.download(generation, "output.wav")
print(f"Audio saved! Duration: {generation.output_duration_seconds}s")
Features
- Sync & Async clients - Use
CronyGenorAsyncCronyGen - Default voices - 20+ pre-configured voices across accents
- Automatic polling - Wait for generation completion
- Type hints - Full type annotations for IDE support
Voices
# List default voices
voices = client.voices.list_defaults(gender="female", accent="american")
for voice in voices:
print(f"{voice.name}: {voice.slug}")
# List your cloned voices (created via dashboard)
my_voices = client.voices.list()
for voice in my_voices.data:
print(f"{voice.name}: {voice.id} ({voice.status})")
# Use a cloned voice for TTS
generation = client.tts.generate(
text="This is my cloned voice!",
voice=my_voices.data[0].id,
voice_type="cloned"
)
Async Usage
import asyncio
from cronygen import AsyncCronyGen
async def main():
async with AsyncCronyGen(api_key="crony_sk_your_api_key") as client:
generation = await client.tts.generate(
text="Hello async world!",
voice="en-uk-ronald"
)
print(f"Audio URL: {generation.output_audio_url}")
asyncio.run(main())
Error Handling
from cronygen import CronyGen, InsufficientCreditsError, RateLimitError
client = CronyGen(api_key="crony_sk_your_api_key")
try:
generation = client.tts.generate(text="Hello world!")
except InsufficientCreditsError as e:
print(f"Not enough credits: {e.available} available, {e.required} required")
except RateLimitError as e:
print(f"Rate limited. Retry after {e.retry_after} seconds")
Documentation
Full documentation at zingotron.com/docs/sdks/python
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cronygen-0.1.0.tar.gz
(10.4 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cronygen-0.1.0.tar.gz.
File metadata
- Download URL: cronygen-0.1.0.tar.gz
- Upload date:
- Size: 10.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c6110c84b8086b88820adf804c20673c220012d09d35dc1ca169fbef61a740e2
|
|
| MD5 |
8a309fb3bb24bc6a27eaa5b73f352dd1
|
|
| BLAKE2b-256 |
337ebd92d62c807bd65aa29b24d1648c6f143b9828a3fd7d2cf3840316eb9eb8
|
File details
Details for the file cronygen-0.1.0-py3-none-any.whl.
File metadata
- Download URL: cronygen-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1cab7d17168794bf063fcd1e7320ab3a28c9e2ce47689d195c8ac60bbfe22336
|
|
| MD5 |
77579cb12612f8335741357906525db3
|
|
| BLAKE2b-256 |
26c4bfd0bd3f676a40ca41558fb00a3d7ffea58e21f4c776d45d3558fc639f10
|