Skip to main content

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)

language is required. Every TTS call must pass a supported language code (e.g. "en", "hi") — there is no default. Omitting it raises a TypeError; an empty or unsupported code raises a ValueError.

With options:

import convozen

client = convozen.Client(api_key="your-api-key")

audio = client.tts.synthesize(
    text="Welcome to Playground.",
    language="en",          # required
    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 required 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_remaining)     # shared credit pool for TTS + STT
print(info.allowed_services)      # e.g. ["tts", "stt"]
print(info.rate_limit.remaining)  # requests left in the current window

Error Handling

import convozen
from convozen import AuthenticationError, RateLimitError, APIError

client = convozen.Client(api_key="your-api-key")

try:
    audio = client.tts.synthesize("Hello", language="en")
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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

convozen-0.3.6.tar.gz (13.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

convozen-0.3.6-py3-none-any.whl (18.3 kB view details)

Uploaded Python 3

File details

Details for the file convozen-0.3.6.tar.gz.

File metadata

  • Download URL: convozen-0.3.6.tar.gz
  • Upload date:
  • Size: 13.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for convozen-0.3.6.tar.gz
Algorithm Hash digest
SHA256 cefa69daf499f19b8108678580edbc843b5f5d9e5c1f5da6e59a8902604bb049
MD5 147164032056da89c1986d2b05d3fdcf
BLAKE2b-256 ab65a0f564c5fdd7d66f29ecbcc212841c2312319e57fdeea9022224d44598e7

See more details on using hashes here.

File details

Details for the file convozen-0.3.6-py3-none-any.whl.

File metadata

  • Download URL: convozen-0.3.6-py3-none-any.whl
  • Upload date:
  • Size: 18.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for convozen-0.3.6-py3-none-any.whl
Algorithm Hash digest
SHA256 7ef71df05ae9f635aded66603fdd37d864c13ae5866c9741aafab941ff499d7c
MD5 b0798cd30f19262ff89119db3164eec0
BLAKE2b-256 b6c9ea8d702f6af9774955849151a46b8a6f1fa6c748eaf9edd98b00c8f5063c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page