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.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", 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.5.tar.gz (13.5 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.5-py3-none-any.whl (18.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: convozen-0.3.5.tar.gz
  • Upload date:
  • Size: 13.5 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.5.tar.gz
Algorithm Hash digest
SHA256 5cad6dc6dafd8258e2d2e04ddb05fac1f6375853b6944d2a9db73fbfb154e9f9
MD5 482b1ce44da0107edbfaf95a7eef858e
BLAKE2b-256 642a75dbea45260567f8c6e3b85216ac47a9b8f744eb2d86357fa98dcdc7869a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: convozen-0.3.5-py3-none-any.whl
  • Upload date:
  • Size: 18.2 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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 28b96a5ce21d28b229ad27175b9589a3568b11078231476075df61a11df87e19
MD5 2e1fb29002806a47e5857d6e1fe27b18
BLAKE2b-256 34e0ef531dc9771866f294a3236e84fc01ea96704d85ef3ee174f91c57564e42

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