unfaithful-mantledgroundsquirrel783/purr

GitHub: unfaithful-mantledgroundsquirrel783/purr

基于ONNX的轻量级CPU文本转语音CLI工具,提供模型管理和音频播放功能。

Stars: 0 | Forks: 0

# purr [KittenTTS](https://github.com/KittenML/KittenTTS) 的 CLI 封装器 — 轻量级基于 ONNX 的文本转语音,运行在 CPU 上,支持模型管理和可选的音频播放。 ## 安装 ### 推荐:精简安装(不含 torch/CUDA) 默认安装会附带 `torch` 和 NVIDIA CUDA 包(几个 GB),这是 `kittentts → misaki[en] → spacy-curated-transformers` 的不必要副作用。使用提供的脚本可以绕过这个问题: ``` git clone https://github.com/newptcai/purr cd purr bash install.sh ``` `install.sh` 将 `purr` 安装为 [uv 工具](https://docs.astral.sh/uv/guides/tools/),因此它会立即在 PATH 中可用,无需激活虚拟环境。 ### 简单安装(含 torch/CUDA 膨胀包) ``` git clone https://github.com/newptcai/purr cd purr uv tool install . ``` ## 快速开始 📖 **查看 [repy](https://github.com/newptcai/repy) — 使用 `purr` 作为默认 TTS 引擎的终端 epub 阅读器。** ``` # 列出可用模型 purr model list # 下载 nano 模型(约 50 MB) purr model install nano # 将语音合成到文件 purr speak "Hello, world." --output hello.wav # 立即播放音频(保存到 /tmp/purr-.wav) purr speak "Hello, world." --play # 从 stdin 管道输入文本 echo "Testing stdin input" | purr speak --play --voice Luna # 将 WAV 写入 stdout 以管道传输到其他工具 purr speak "Hello, world." --stdout > hello.wav purr speak "Hello, world." --stdout | aplay - # 列出当前模型的语音 purr voices ``` ## 命令 ### `purr model` | 命令 | 描述 | |---|---| | `purr model list` | 显示所有模型及其安装状态 | | `purr model install ` | 下载并安装模型 | | `purr model remove ` | 移除已安装的模型 | 可用的模型别名:`mini`、`micro`、`nano`、`nano-int8` ### `purr speak` ``` purr speak [TEXT] [OPTIONS] ``` | 选项 | 简写 | 默认值 | 描述 | |---|---|---|---| | `--model` | `-m` | 最佳已安装 | 模型别名 | | `--voice` | `-V` | `Jasper` | 语音名称 | | `--speed` | `-s` | `1.0` | 速度倍数 | | `--output` | `-o` | `/tmp/purr-.wav` | 输出 `.wav` 文件 | | `--play` / `--no-play` | `-p` | 关闭 | 合成后播放音频 | | `--stdout` | | 关闭 | 将 WAV 音频写入 stdout(用于管道传输) | | `--clean` / `--no-clean` | | 开启 | 文本预处理 | | `--quiet` | `-q` | 关闭 | 抑制信息输出 | 如果省略 `TEXT`,则从 stdin 读取输入。 ### `purr voices` ``` purr voices [--model nano] ``` 列出指定模型可用的语音。 ## 模型缓存 模型默认存储在 `~/.cache/kitten-cli/models/`。 如果设置了 `$XDG_CACHE_HOME`,则遵循该环境变量。 ## 许可证 MIT ## 集成 `purr` 是 [repy](https://github.com/newptcai/repy) 中的默认 TTS 工具,repy 是一个用 Rust 编写的终端 epub 阅读器。
标签:CNCF毕业项目, CPU推理, KittenTTS, LangChain, ONNX, Python, stdin, stdout, TTS, uv工具, WAV, 开源, 文本转语音, 无后门, 模型管理, 管道, 终端工具, 语音合成, 语音播放, 轻量级, 逆向工具, 音频处理