Skip to content

Commit 6929847

Browse files
committed
update readme
1 parent 35fc258 commit 6929847

2 files changed

Lines changed: 114 additions & 49 deletions

File tree

README-CN.md

Lines changed: 55 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -13,41 +13,75 @@
1313

1414
# RapidSpeech.cpp 🎙️
1515

16-
在本地用一个 GGUF 驱动的 C++ runtime 跑 ASR 和 TTS
16+
面向 Python 开发者的本地 ASR / TTS,底层由 C++ GGUF runtime 驱动
1717

18-
**RapidSpeech.cpp** 是一个纯 C/C++ 语音推理引擎,面向端侧语音识别、语音合成、VAD、说话人嵌入和声音克隆。它使用 **ggml** 后端和统一的 **GGUF** 模型格式,让部署变成一个原生 runtime 加一个模型文件
18+
**RapidSpeech.cpp** 给 Python 开发者提供简单的本地语音识别、语音合成、VAD、说话人嵌入和声音克隆 API。底层使用纯 C/C++ 引擎、**ggml** 后端和统一的 **GGUF** 模型格式,所以你写的是 Python,跑的是原生性能,不需要启动语音服务
1919

2020
------
2121

22-
## 60 秒搞定
22+
## Python 60 秒跑起来
23+
24+
### 安装
25+
26+
```bash
27+
pip install rapidspeech
28+
```
29+
30+
GPU wheel:
31+
32+
```bash
33+
pip install rapidspeech-metal # macOS / Apple Silicon
34+
pip install rapidspeech-cuda # Linux / NVIDIA
35+
```
2336

2437
### 文本转语音
2538

2639
```bash
27-
./build/rs-tts-offline \
28-
-m /path/to/omnivoice-f16.gguf \
29-
-t "Hello, welcome to RapidSpeech." \
30-
--lang English \
31-
-o output.wav
40+
python python-api-examples/tts/tts-offline.py \
41+
--model /path/to/omnivoice-f16.gguf \
42+
--text "Hello, welcome to RapidSpeech." \
43+
--output output.wav
3244
```
3345

3446
### 语音转文本
3547

3648
```bash
37-
./build/rs-asr-offline \
38-
-m /path/to/funasr-nano-fp16.gguf \
39-
-w /path/to/audio.wav \
40-
--gpu true
49+
python python-api-examples/asr/asr-offline.py \
50+
--model /path/to/funasr-nano-fp16.gguf \
51+
--audio /path/to/audio.wav
52+
```
53+
54+
### Python API
55+
56+
```python
57+
import rapidspeech
58+
59+
tts = rapidspeech.tts_synthesizer("/path/to/omnivoice-f16.gguf")
60+
tts.set_params(instruct="male, young adult", language="English", seed=42)
61+
pcm = tts.synthesize("Hello from a native speech engine.")
62+
sample_rate = tts.get_sample_rate()
63+
```
64+
65+
```python
66+
import rapidspeech
67+
68+
asr = rapidspeech.asr_offline("/path/to/funasr-nano-fp16.gguf")
69+
sample_rate = asr.get_model_meta()["audio_sample_rate"]
70+
pcm = ... # 1-D float32 mono PCM,采样率为 sample_rate
71+
asr.push_audio(pcm)
72+
asr.process()
73+
print(asr.get_text())
4174
```
4275

4376
------
4477

4578
## 为什么是 RapidSpeech.cpp
4679

80+
- **Python API,原生核心**:写 Python,底层跑 C++ / ggml 引擎。
4781
- **一个模型格式**:ASR、TTS、VAD、说话人模型都使用 GGUF。
48-
- **一个原生 runtime**纯 C/C++,生产环境不需要 Python runtime
49-
- **一个端侧后端栈**CPU、Metal、CUDA、Vulkan、CANN、OpenCL、WebGPU
50-
- **为语音而生**VAD 分段、流式缓冲、声音克隆、量化,以及 Apple Metal DAC 加速
82+
- **NumPy 输入输出**ASR 接收 float32 PCM;TTS 返回 float32 PCM
83+
- **默认本地运行**没有云 API,没有语音服务,没有 Python 模型栈
84+
- **端侧后端栈**CPU、Metal、CUDA、Vulkan、CANN、OpenCL、WebGPU
5185

5286
------
5387

@@ -83,14 +117,14 @@ CosyVoice3、Qwen3-ASR、Qwen3-TTS。
83117

84118
## 文档
85119

86-
- [技术说明](docs/TECHNICAL-CN.md):架构、设计取舍、后端、模型转换和绑定接口。
87120
- [Python 示例](python-api-examples/README.md)
121+
- [技术说明](docs/TECHNICAL-CN.md):架构、设计取舍、后端、模型转换和绑定接口。
88122
- [浏览器 / WASM 示例](wasm-examples/README.md)
89123
- [Node.js 示例](node-api-example/README.md)
90124

91125
------
92126

93-
## 🛠️ 快速开始
127+
## 原生 C++ CLI
94128

95129
### 模型下载
96130

@@ -159,11 +193,7 @@ cmake --build build --config Release
159193

160194
### Python
161195

162-
```bash
163-
pip install rapidspeech
164-
```
165-
166-
详细 CLI 参数、Python API、多语言绑定和模型转换说明见 [技术说明](docs/TECHNICAL-CN.md)
196+
离线 ASR、流式 ASR、离线 TTS、流式 TTS、VAD 和声音克隆见 [Python 示例](python-api-examples/README.md)
167197

168198
------
169199

@@ -180,3 +210,6 @@ pip install rapidspeech
180210
1. [Fun-ASR](https://github.com/FunAudioLLM/Fun-ASR)
181211
2. [llama.cpp](https://github.com/ggml-org/llama.cpp)
182212
3. [ggml](https://github.com/ggml-org/ggml)
213+
4. [cppjieba](https://github.com/yanyiwu/cppjieba) —— 中文分词
214+
5. [WeText](https://github.com/wenet-e2e/wetext) —— 文本归一化(ITN/TN)
215+
6. [miniaudio](https://github.com/mackron/miniaudio) —— 单文件音频 I/O

README.md

Lines changed: 59 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -14,45 +14,78 @@ English | [简体中文](./README-CN.md)
1414

1515
# RapidSpeech.cpp 🎙️
1616

17-
Run local ASR and TTS from one GGUF-powered C++ runtime.
17+
Python-friendly local ASR and TTS, powered by a native C++ GGUF runtime.
1818

19-
**RapidSpeech.cpp** is a pure C/C++ speech inference engine for on-device
20-
speech recognition, text-to-speech, VAD, speaker embedding, and voice cloning.
21-
It uses **ggml** backends and a unified **GGUF** model format, so deployment is
22-
one native runtime plus one model file.
19+
**RapidSpeech.cpp** gives Python developers a simple API for local speech
20+
recognition, text-to-speech, VAD, speaker embedding, and voice cloning. Under
21+
the hood it uses a pure C/C++ engine, **ggml** backends, and a unified **GGUF**
22+
model format, so you get native performance without running a speech server.
2323

2424
------
2525

26-
## Try It In 60 Seconds
26+
## Python In 60 Seconds
27+
28+
### Install
29+
30+
```bash
31+
pip install rapidspeech
32+
```
33+
34+
GPU wheels:
35+
36+
```bash
37+
pip install rapidspeech-metal # macOS / Apple Silicon
38+
pip install rapidspeech-cuda # Linux / NVIDIA
39+
```
2740

2841
### Text to speech
2942

3043
```bash
31-
./build/rs-tts-offline \
32-
-m /path/to/omnivoice-f16.gguf \
33-
-t "Hello, welcome to RapidSpeech." \
34-
--lang English \
35-
-o output.wav
44+
python python-api-examples/tts/tts-offline.py \
45+
--model /path/to/omnivoice-f16.gguf \
46+
--text "Hello, welcome to RapidSpeech." \
47+
--output output.wav
3648
```
3749

3850
### Speech to text
3951

4052
```bash
41-
./build/rs-asr-offline \
42-
-m /path/to/funasr-nano-fp16.gguf \
43-
-w /path/to/audio.wav \
44-
--gpu true
53+
python python-api-examples/asr/asr-offline.py \
54+
--model /path/to/funasr-nano-fp16.gguf \
55+
--audio /path/to/audio.wav
56+
```
57+
58+
### Python API
59+
60+
```python
61+
import rapidspeech
62+
63+
tts = rapidspeech.tts_synthesizer("/path/to/omnivoice-f16.gguf")
64+
tts.set_params(instruct="male, young adult", language="English", seed=42)
65+
pcm = tts.synthesize("Hello from a native speech engine.")
66+
sample_rate = tts.get_sample_rate()
67+
```
68+
69+
```python
70+
import rapidspeech
71+
72+
asr = rapidspeech.asr_offline("/path/to/funasr-nano-fp16.gguf")
73+
sample_rate = asr.get_model_meta()["audio_sample_rate"]
74+
pcm = ... # 1-D float32 mono PCM at sample_rate
75+
asr.push_audio(pcm)
76+
asr.process()
77+
print(asr.get_text())
4578
```
4679

4780
------
4881

4982
## Why RapidSpeech.cpp
5083

84+
- **Python API, native core**: write Python, run a C++/ggml engine underneath.
5185
- **One model format**: ASR, TTS, VAD, and speaker models use GGUF.
52-
- **One native runtime**: pure C/C++, no Python runtime required in production.
53-
- **One edge-first backend stack**: CPU, Metal, CUDA, Vulkan, CANN, OpenCL, and WebGPU.
54-
- **Built for speech**: VAD segmentation, streaming buffers, voice cloning,
55-
quantization, and Apple Metal DAC acceleration.
86+
- **NumPy in, NumPy out**: ASR takes float32 PCM; TTS returns float32 PCM.
87+
- **Local by default**: no cloud API, no speech server, no Python model stack.
88+
- **Edge-first backends**: CPU, Metal, CUDA, Vulkan, CANN, OpenCL, and WebGPU.
5689

5790
------
5891

@@ -89,15 +122,15 @@ CosyVoice3, Qwen3-ASR, Qwen3-TTS.
89122

90123
## Documentation
91124

125+
- [Python examples](python-api-examples/README.md)
92126
- [Technical Notes](docs/TECHNICAL.md): architecture, design tradeoffs, backends,
93127
model conversion, and binding surfaces.
94-
- [Python examples](python-api-examples/README.md)
95128
- [Browser / WASM examples](wasm-examples/README.md)
96129
- [Node.js example](node-api-example/README.md)
97130

98131
------
99132

100-
## 🛠️ Quick Start
133+
## Native C++ CLI
101134

102135
### Download Models
103136

@@ -166,12 +199,8 @@ Build artifacts are located in the `build/` directory:
166199

167200
### Python
168201

169-
```bash
170-
pip install rapidspeech
171-
```
172-
173-
Detailed CLI flags, Python APIs, binding surfaces, and model conversion recipes
174-
live in [Technical Notes](docs/TECHNICAL.md).
202+
See [Python examples](python-api-examples/README.md) for offline ASR, streaming
203+
ASR, offline TTS, streaming TTS, VAD, and voice cloning.
175204

176205
------
177206

@@ -188,3 +217,6 @@ If you are interested in the following areas, we welcome your PRs or participati
188217
1. [Fun-ASR](https://github.com/FunAudioLLM/Fun-ASR)
189218
2. [llama.cpp](https://github.com/ggml-org/llama.cpp)
190219
3. [ggml](https://github.com/ggml-org/ggml)
220+
4. [cppjieba](https://github.com/yanyiwu/cppjieba) — Chinese word segmentation
221+
5. [WeText](https://github.com/wenet-e2e/wetext) — text normalization (ITN/TN)
222+
6. [miniaudio](https://github.com/mackron/miniaudio) — single-file audio I/O

0 commit comments

Comments
 (0)