Skip to main content

Kokoro TTS integration for Vision Agents

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vision_agents_plugins_kokoro-0.2.5.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

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

vision_agents_plugins_kokoro-0.2.5-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file vision_agents_plugins_kokoro-0.2.5.tar.gz.

File metadata

File hashes

Hashes for vision_agents_plugins_kokoro-0.2.5.tar.gz
Algorithm Hash digest
SHA256 87db6a3d3dc75cbf982d5069b25dbea560a72f0e612da6149a019a0ee507876d
MD5 d65d1263d6e4e1860b179cb5cd6d3693
BLAKE2b-256 3197f57bf8023d9c3a36bbd4c5459232d1d6d1a51dbfc03148a158cdd203346a

See more details on using hashes here.

File details

Details for the file vision_agents_plugins_kokoro-0.2.5-py3-none-any.whl.

File metadata

File hashes

Hashes for vision_agents_plugins_kokoro-0.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 9bd45d24a4c29088ac0e3d5b75796d25b3c5593f292a5c41702f37285d9872c3
MD5 d11cdd8e2ae6cdb9fe2297270dcbb92b
BLAKE2b-256 a49d1effb14aa6a22a19f8f6dfc3f63404d5f3e36104e6707a26856d2b89cdcf

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