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")

text = client.stt.transcribe("recording.wav")
print(text)

Parameters

Parameter Type Default Description
audio str required Path to the audio file (WAV format)
model str "akshara-v1" STT model to use. Currently only akshara-v1 is available

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")
text = stt.transcribe("audio.wav")

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.1.tar.gz (10.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.1-py3-none-any.whl (15.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for convozen-0.3.1.tar.gz
Algorithm Hash digest
SHA256 3f1516105ab8a23d23ddadcc44243e43de5aef34611d31bda0aa484174de5b1d
MD5 2c9ee08e69694e2d1a988dbef473b213
BLAKE2b-256 1f36402c6080ed0edb275924beb728c344400ac0e86ad9a211e752e85adfe621

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for convozen-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 dc108d5570fc0f9d71b6f89fe2e86d626e600b77750f28ebdc36179bb6f618cf
MD5 6f7c5206ef4d5ceba3ede41ae7ca3f3a
BLAKE2b-256 4743995fa79bc3228c69b7d057343a705e5d66c018593334632e80873c49690e

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