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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file kova_tts-0.1.5.tar.gz.
File metadata
- Download URL: kova_tts-0.1.5.tar.gz
- Upload date:
- Size: 24.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
83149feb6074211b09a18fac6c42c4a8e7b6fb3e903f04283402d9f50b1c1fb5
|
|
| MD5 |
028b8ca083748b583df030c0924b372f
|
|
| BLAKE2b-256 |
ae6c14382d300fea16e1feac5477fc6c091d6449466678f598076640f1936590
|
Provenance
The following attestation bundles were made for kova_tts-0.1.5.tar.gz:
Publisher:
publish-python.yml on evalabs-ai/kova-tts-clients
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kova_tts-0.1.5.tar.gz -
Subject digest:
83149feb6074211b09a18fac6c42c4a8e7b6fb3e903f04283402d9f50b1c1fb5 - Sigstore transparency entry: 1662403767
- Sigstore integration time:
-
Permalink:
evalabs-ai/kova-tts-clients@9a489fcfa972d2e7a6357cc06ebabd65a4531b46 -
Branch / Tag:
refs/tags/v0.1.5 - Owner: https://github.com/evalabs-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@9a489fcfa972d2e7a6357cc06ebabd65a4531b46 -
Trigger Event:
push
-
Statement type:
File details
Details for the file kova_tts-0.1.5-py3-none-any.whl.
File metadata
- Download URL: kova_tts-0.1.5-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7bc9006b701d5fefb1bb2d34aacbad09a4c93ccfc894551f6a0218cf4c1ab6dc
|
|
| MD5 |
d5713b1c107b489c988d3aa8b479a351
|
|
| BLAKE2b-256 |
a0ba090e3e4949bb3cdab0a6279dad61328f77cd77a547ceed95bc4a4c54ce63
|
Provenance
The following attestation bundles were made for kova_tts-0.1.5-py3-none-any.whl:
Publisher:
publish-python.yml on evalabs-ai/kova-tts-clients
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kova_tts-0.1.5-py3-none-any.whl -
Subject digest:
7bc9006b701d5fefb1bb2d34aacbad09a4c93ccfc894551f6a0218cf4c1ab6dc - Sigstore transparency entry: 1662403861
- Sigstore integration time:
-
Permalink:
evalabs-ai/kova-tts-clients@9a489fcfa972d2e7a6357cc06ebabd65a4531b46 -
Branch / Tag:
refs/tags/v0.1.5 - Owner: https://github.com/evalabs-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@9a489fcfa972d2e7a6357cc06ebabd65a4531b46 -
Trigger Event:
push
-
Statement type: