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.1.0.tar.gz (3.4 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.1.0-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for vision_agents_plugins_kokoro-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7b812d73e97c1263390e9190ec955b4c9e1a3fa3be838789ce0179e8401cbe4f
MD5 30956e0cfa33451af824bb19cb9f083d
BLAKE2b-256 2789fa4a175ab333c600f1ca938ac0adc91f97201e1618219b2223402ed26566

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for vision_agents_plugins_kokoro-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 885b69acfaa5f7e1ed90f947dfcd70dbd2e5aa53e66451432d7967ee126321cf
MD5 bd7c57856e55cb876ded4b6fd55f2558
BLAKE2b-256 1b80539961fa82da5a19007b99dd712e2a47695e7dc01737c2431bf1b04a4c27

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