Add JavaScript API (node-addon) for Kokoro TTS 1.0 (#1808)

This commit is contained in:
Fangjun Kuang
2025-02-07 16:26:41 +08:00
committed by GitHub
parent c254504921
commit 19513af0ae
4 changed files with 73 additions and 0 deletions

View File

@@ -134,6 +134,7 @@ The following tables list the examples in this folder.
|File| Description|
|---|---|
|[./test_tts_non_streaming_kokoro_en.js](./test_tts_non_streaming_kokoro_en.js)| Text-to-speech with a Kokoro English Model|
|[./test_tts_non_streaming_kokoro_zh_en.js](./test_tts_non_streaming_kokoro_zh_en.js)| Text-to-speech with a Kokoro Model supporting Chinese and English|
|[./test_tts_non_streaming_matcha_icefall_en.js](./test_tts_non_streaming_matcha_icefall_en.js)| Text-to-speech with a [MatchaTTS English Model](https://k2-fsa.github.io/sherpa/onnx/tts/pretrained_models/matcha.html#matcha-icefall-en-us-ljspeech-american-english-1-female-speaker)|
|[./test_tts_non_streaming_matcha_icefall_zhjs](./test_tts_non_streaming_matcha_icefall_zh.js)| Text-to-speech with a [MatchaTTS Chinese Model](https://k2-fsa.github.io/sherpa/onnx/tts/pretrained_models/matcha.html#matcha-icefall-zh-baker-chinese-1-female-speaker)|
|[./test_tts_non_streaming_vits_piper_en.js](./test_tts_non_streaming_vits_piper_en.js)| Text-to-speech with a [piper](https://github.com/rhasspy/piper) English model|
@@ -348,6 +349,16 @@ npm install naudiodon2
node ./test_vad_asr_non_streaming_sense_voice_microphone.js
```
### Text-to-speech with Kokoro TTS models (Chinese + English TTS)
```bash
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/kokoro-multi-lang-v1_0.tar.bz2
tar xf kokoro-multi-lang-v1_0.tar.bz2
rm kokoro-multi-lang-v1_0.tar.bz2
node ./test_tts_non_streaming_kokoro_zh_en.js
```
### Text-to-speech with Kokoro TTS models (English TTS)
```bash