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)

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.wav")
print(result.text)

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.3.tar.gz (11.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.3-py3-none-any.whl (16.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: convozen-0.3.3.tar.gz
  • Upload date:
  • Size: 11.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.10

File hashes

Hashes for convozen-0.3.3.tar.gz
Algorithm Hash digest
SHA256 a0a9e6caf1b3242bfa72f11e59c4201fc5511d54fee444aa49a13451688cf2f2
MD5 3fe2b66d927356dde5db9a16e919a2d3
BLAKE2b-256 85244c1c4ee7ea43a2b799f5f58e7cb3e7371d62200521807b041a4a894c0f01

See more details on using hashes here.

File details

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

File metadata

  • Download URL: convozen-0.3.3-py3-none-any.whl
  • Upload date:
  • Size: 16.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.10

File hashes

Hashes for convozen-0.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d3f0a8380c51cc452b6cafcb4f00b01f7b3ffa6b2a058f94f97fb980681cfe60
MD5 c2b1ebae5be900b8157cc51e56b16127
BLAKE2b-256 53c222fd29ff9e44abdf5cf8f9769e1f56075c8c3bfba8c391bcc733f909231a

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