Python SDK for ConvoZen TTS and STT services
Project description
ConvoZen Voice SDK
Text-to-Speech (TTS) and Speech-to-Text (STT) for Python.
One API key for both TTS and STT.
Install
pip install convozen
Requires Python 3.9+
TTS — Convert Text to Speech
Copy and run:
import convozen
client = convozen.Client(api_key="your-api-key")
audio = client.tts.synthesize("नमस्ते… मुझे आपके सर्विस के बारे में थोड़ी जानकारी चाहिए।", language="hi")
with open("output.wav", "wb") as f:
f.write(audio)
With options:
import convozen
client = convozen.Client(api_key="your-api-key")
audio = client.tts.synthesize(
text="Welcome to Playground.",
language="en", # default: "en"
voice="roohi", # default: "roohi"
model="ragini-v1", # default: "ragini-v1"
speed=1.2, # default: 1.0
)
with open("output.wav", "wb") as f:
f.write(audio)
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
text |
str |
required | Text to convert to speech |
language |
str |
"en" |
Language code (see supported languages below) |
voice |
str |
"roohi" |
Voice ID for synthesis (see available voices below) |
model |
str |
"ragini-v1" |
TTS model to use. Currently only ragini-v1 is available |
speed |
float |
1.0 |
Speech speed. 0.5 = half speed, 2.0 = double speed |
stream |
bool |
False |
If True, returns audio chunks as they are generated |
format |
str |
"wav" |
Audio output format. Currently only wav is supported |
Streaming
import convozen
client = convozen.Client(api_key="your-api-key")
for chunk in client.tts.synthesize("Long text here...", language="en", stream=True):
audio_player.write(chunk)
Available Voices
| Voice | ID | Default |
|---|---|---|
| Roohi | roohi |
Yes |
| Amaya | amaya |
|
| Kiyansh | kiyansh |
|
| Neeraj | neeraj |
|
| Manya | manya |
|
| Nidhi | nidhi |
|
| Ira | ira |
|
| Trisha | trisha |
|
| Charvi | charvi |
audio = client.tts.synthesize("Hello", language="en", voice="roohi")
STT — Convert Speech to Text
Copy and run:
import convozen
client = convozen.Client(api_key="your-api-key")
result = client.stt.transcribe("recording.wav")
print(result.text) # "hello how can I help you"
print(result.score) # -2.45 (confidence — closer to 0 is better)
Specify Languages
If you know which languages are spoken in the audio, pass them in lang_tags. This improves accuracy — especially for multilingual audio like Hindi + English call recordings:
result = client.stt.transcribe(
"recording.wav",
lang_tags=["hi", "en"],
)
print(result.text) # "हां मुझे appointment reschedule करना है"
Keyword Boosting
Have domain-specific words that the model keeps getting wrong? Pass them in keywords and the model will try harder to recognize them:
# Without keyword boosting: "can you tell me about conversion"
# With keyword boosting: "can you tell me about convozen"
result = client.stt.transcribe(
"recording.wav",
keywords=["convozen", "akshara"],
)
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
audio |
str |
required | Path to the audio file |
lang_tags |
list[str] |
None |
Languages in the audio ("en", "hi", "te", etc.) |
keywords |
list[str] |
None |
Words the model should try harder to recognize |
Supported Languages
| Code | Language | TTS | STT |
|---|---|---|---|
en |
English | Yes | Yes |
hi |
Hindi | Yes | Yes |
ta |
Tamil | Yes | Yes |
te |
Telugu | Yes | Yes |
kn |
Kannada | Yes | Yes |
mr |
Marathi | — | Yes |
bn |
Bengali | — | Yes |
gu |
Gujarati | — | Yes |
ml |
Malayalam | — | Yes |
Check Credits
import convozen
client = convozen.Client(api_key="your-api-key")
info = client.account.info()
print(info.credits.tts.balance)
print(info.credits.stt.balance)
Error Handling
import convozen
from convozen import AuthenticationError, RateLimitError, APIError
client = convozen.Client(api_key="your-api-key")
try:
audio = client.tts.synthesize("Hello")
except AuthenticationError:
print("Invalid API key")
except RateLimitError:
print("Too many requests")
except APIError as e:
print(f"Server error: {e}")
Standalone Clients
from convozen import TTS, STT
tts = TTS(api_key="your-api-key")
audio = tts.synthesize("Hello", language="hi")
stt = STT(api_key="your-api-key")
result = stt.transcribe(
audio_path,
type="transcript"
)
print("=== Transcript ===")
print(result.text)
# =========================================================
# Speaker Diarization (default behavior)
# =========================================================
result = client.stt.transcribe(audio_path)
print("\n=== Speaker Turns ===")
for turn in result.turns:
print(f"[{turn.speaker_id}] {turn.start_sec:.2f}s - {turn.end_sec:.2f}s : {turn.transcript}")
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
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 convozen-0.3.4.tar.gz.
File metadata
- Download URL: convozen-0.3.4.tar.gz
- Upload date:
- Size: 13.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
78b7c783ed93f5786f927e0bf8edf0af75b73337be18851e3c8622e68f727d54
|
|
| MD5 |
66935d303adfb3d6cce6506e26f623e0
|
|
| BLAKE2b-256 |
c61ed23be3035b19278ca5a576d9ffe6693d3963c1f29e98462e9724533c73c2
|
File details
Details for the file convozen-0.3.4-py3-none-any.whl.
File metadata
- Download URL: convozen-0.3.4-py3-none-any.whl
- Upload date:
- Size: 18.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0ebfc9c7db8908c6154bc716bc6a86639e49eedea5b9bd85d023d902fc253455
|
|
| MD5 |
10fce37671a463e8ca4cb7b020fd013f
|
|
| BLAKE2b-256 |
3e3233d7cef38d4d4e03e679237878faa5bc91ad2f039e89620f031d38d06c86
|