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.4.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.4-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: kova_tts-0.1.4.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.4.tar.gz
Algorithm Hash digest
SHA256 f60e45a312abb978de6a85ddc84656f39b2d5a06ba4039512a3308e941109b99
MD5 4a6a8a8fdc691256de249d7b139914b2
BLAKE2b-256 3fbc3ede02e6beb6d075e9139802c929be3c055a2fefec77b59fc5d02aa4d106

See more details on using hashes here.

Provenance

The following attestation bundles were made for kova_tts-0.1.4.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.4-py3-none-any.whl.

File metadata

  • Download URL: kova_tts-0.1.4-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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 c32dbe6890ca2f9b8775b5b828ba294961da7ee75ed2f0a72066ecd771b13c77
MD5 65c62eeb9c2a3e0f76a79f42b33b76e3
BLAKE2b-256 192ca907e62901e0b1d377bd4a90a3846cb42b40dd4b181fe480fce4f8e78770

See more details on using hashes here.

Provenance

The following attestation bundles were made for kova_tts-0.1.4-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