Skip to main content

Official Python client for the Kova TTS API.

Project description

kova-tts

Python client for the Kova TTS API.

Install

pip install kova-tts

Setup

from kova_tts import KovaTTSClient

client = KovaTTSClient(
    api_key="YOUR_API_KEY",
)

Sync

from kova_tts import AudioResponseFormat

result = client.tts(
    text="Hello world.",
    voice="cal",
    response_format=AudioResponseFormat(encoding="mp3"),
    timestamps=True,
    normalize_text=True,
)

client.write_audio_file(result.audio, "out.mp3")
print(result.timestamps.words if result.timestamps else None)

Streaming

from kova_tts import AudioResponseFormat

async for event in client.stream_tts(
    text="Hello world.",
    voice="cal",
    response_format=AudioResponseFormat(encoding="mp3"),
    timestamps=True,
    normalize_text=True,
):
    if event.type == "audio":
        print(f"received {len(event.audio)} audio bytes")
    elif event.type == "timestamps":
        print(event.words)

WebSocket

from kova_tts import AudioResponseFormat

async with client.websocket() as ws:
    await ws.start_context(
        context_id="ctx-1",
        voice_id="cal",
        model_id="default",
        timestamps=True,
        response_format=AudioResponseFormat(encoding="pcm", sample_rate=32000),
    )

    await ws.send_text("Hello ", context_id="ctx-1")
    await ws.send_text("world.", context_id="ctx-1")
    await ws.flush(context_id="ctx-1")

    async for frame in ws:
        match frame.type:
            case "audio":
                print(f"received {len(frame.audio)} audio bytes")
            case "timestamps":
                print(frame.timestamps.words)
            case "flush_completed":
                break

Response Formats

response_format supports mp3, pcm, wav, linear16, opus, mulaw, and alaw.

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

kova_tts-0.1.3.tar.gz (23.7 kB view details)

Uploaded Source

Built Distribution

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

kova_tts-0.1.3-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file kova_tts-0.1.3.tar.gz.

File metadata

  • Download URL: kova_tts-0.1.3.tar.gz
  • Upload date:
  • Size: 23.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for kova_tts-0.1.3.tar.gz
Algorithm Hash digest
SHA256 cfa2e1cf0ab6b35aa5c4a66f2a54873fe5f9ce40d3435f8f69573db92e0b7a45
MD5 3c716b188a4e847b8d293f964cbe7d7f
BLAKE2b-256 dddd2ef1b01b2a12fe8df355f07e7c9886f1751da5d873ba81e7766a5cd850f3

See more details on using hashes here.

Provenance

The following attestation bundles were made for kova_tts-0.1.3.tar.gz:

Publisher: publish-python.yml on evalabs-ai/kova-tts-clients

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file kova_tts-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: kova_tts-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 8.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for kova_tts-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ce76899ef84be251b05353926835c485c9746d16d07485ca47fcc3a971a5b6a0
MD5 31cd60a70f06991b3cdc39328c9074d4
BLAKE2b-256 041173aeb039e88567fda749a050c5d02a32d253c2231b8d6f7ea807cd94fa76

See more details on using hashes here.

Provenance

The following attestation bundles were made for kova_tts-0.1.3-py3-none-any.whl:

Publisher: publish-python.yml on evalabs-ai/kova-tts-clients

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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