StreamingKokoroJS  by rhulha

Browser-based text-to-speech

created 2 months ago
257 stars

Top 98.8% on sourcepulse

GitHubView on GitHub
Project Summary

This project provides a 100% client-side, open-source text-to-speech (TTS) solution for the browser, leveraging the Kokoro-82M model. It's designed for users seeking private, offline TTS capabilities without server-side processing, offering high-quality audio generation directly within modern web browsers.

How It Works

The application utilizes the Kokoro-82M-v1.0-ONNX model, which is downloaded and cached locally. It employs Web Workers to prevent UI blocking during audio generation. For performance, it automatically prioritizes WebGPU acceleration on compatible hardware and falls back to WebAssembly (WASM) for broader browser support, ensuring efficient, high-quality (24kHz) streaming audio output.

Quick Start & Requirements

  • Clone the repository and serve the files using a local web server.
  • Requires a modern browser, with Chromium-based browsers (Chrome, Edge) recommended for WebGPU support. Firefox is noted as not currently working.
  • The Kokoro-82M-v1.0-ONNX model (~300MB) is downloaded on first use.

Highlighted Details

  • 100% client-side processing ensures privacy and offline functionality.
  • WebGPU acceleration is automatically utilized for faster performance.
  • Streams audio as it's generated, with smart text chunking for natural speech.
  • Supports multiple voice styles and allows audio downloads.

Maintenance & Community

The project is open source under the Apache 2 License. It acknowledges contributions from Hugging Face Transformers.js and the Kokoro-82M Model.

Licensing & Compatibility

Licensed under the Apache 2 License, permitting commercial use and integration with closed-source applications.

Limitations & Caveats

Firefox is reported as not working at the moment. WebGPU support is recommended for optimal performance, implying potential limitations on older or less capable hardware.

Health Check
Last commit

1 month ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
259 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.