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.0.17.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

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

File details

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

File metadata

File hashes

Hashes for vision_agents_plugins_kokoro-0.0.17.tar.gz
Algorithm Hash digest
SHA256 efc69ec7000b78e39772ea6334689163a064c1f89a5f3a53637161d43462eea4
MD5 184730be984ddc2619f8cb843dbaf616
BLAKE2b-256 ef9433f9fc25704f67df2f8ffd6759a7cbaa563fbf6420d6a332035617f04f2c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for vision_agents_plugins_kokoro-0.0.17-py3-none-any.whl
Algorithm Hash digest
SHA256 0c228e75869ca51a9f74f26ae2517a183ad138215d47269d33051587f76de440
MD5 1bf0f3ec62cf4e11f7d9a7030dd415df
BLAKE2b-256 29b6b2c2498d43f14dad445602efdd8a37a0117ff83305c4daaf80671c17fa9e

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