Kokoro TTS plugin for GetStream
Project description
GetStream Kokoro Plugin
This package integrates the open-weight Kokoro-82M TTS model with the GetStream audio/video SDK.
It provides a drop-in KokoroTTS class that implements the common getstream_common.tts.TTS interface, allowing you to stream PCM audio generated by Kokoro directly into a WebRTC AudioStreamTrack.
from getstream.plugins.kokoro import KokoroTTS
from getstream.video.rtc.audio_track import AudioStreamTrack
track = AudioStreamTrack(framerate=24_000)
tts = KokoroTTS(lang_code="a", voice="af_heart")
tts.set_output_track(track)
await tts.send("Hello from Kokoro!")
Installation
pip install getstream-plugins-kokoro
This will pull in the required kokoro, numpy and getstream[webrtc] dependencies. You also need espeak-ng at runtime for pronunciation fallback. On macOS you can install it with Homebrew:
brew install espeak-ng
Configuration options
| Parameter | Default | Description |
|---|---|---|
lang_code |
"a" |
Language group passed to KPipeline ("a" = American English, etc.) |
voice |
"af_heart" |
Kokoro voice preset. See the model card for available options. |
speed |
1.0 |
Playback speed multiplier. |
sample_rate |
24000 |
Output sample-rate (fixed by Kokoro). The attached AudioStreamTrack must use the same value. |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
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 getstream_plugins_kokoro-0.1.0-py3-none-any.whl.
File metadata
- Download URL: getstream_plugins_kokoro-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ba10146c65dbd3c7e36d44674c7f738ac4672584b70ce76c433b05ae49a7e40d
|
|
| MD5 |
7d848193823dfbe17cc09ca4075d8c5c
|
|
| BLAKE2b-256 |
ec31d21ee963317d167e6b9f71c3b200858f2c8e927299dd6ec5f81b04e3d0b8
|