声音
- 作者仓库星标 0
- 作者仓库 skills-registry
- 领域
- 通用
- 作者声明的智能体
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 88 / 100 · 启发式扫描,不代表运行安全
- 运行环境证据
- 未执行;当前没有隔离运行测试证据
- 作者 / 版本 / 许可证
- @tomevault-io · 未声明许可证
- 上下文用量评级
- 低消耗
- 接入复杂程度
- 需简单配置
- 是否需要外部接口密钥
- 不需要
- 兼容的系统
- macOS · Linux · Windows
- 运行环境要求
- Python >=3.10
- 检测到的文件与系统行为
-
- 只读
- 允许写入 / 修改
- 命令执行
- 网络行为
- 仅限本地
- 安装命令数
- 无(仅作为资料)
需要注意: 未声明工具权限范围;实际权限由运行环境决定。
运行这些检查。如果其中一个失败,请告诉用户要安装什么并停止:需要 Python 3.10+。如果未找到 `python`,请尝试 `python3` (macOS/Linux) 或 `py` (Windows)。如果缺少:“从 python.org 安装 Python 3.10 或更高版本,然后重新启动 Claude。”需要克劳德 CLI。如果缺少:“首先安装 Claude CLI — https://claude.com/claude-code”
安装到插件本地 venv,而不是用户的系统 Python。这可以避开现代 Debian/Ubuntu/Fedora 上的 PEP 668(其中 `pip install --user` 被拒绝),并保持 fast-whisper 的重型依赖隔离,因此卸载只需 `rm -rf .venv`。首先检查 venv 是否已经存在并具有 deps:如果 venv 不存在,则创建它(告诉用户“设置语音模式(一次性,~200 MB)...”):
使用 AskUserQuestion 回答以下四个问题(在一次往返中一次呼叫中发送全部四个问题 — AskUserQuestion 工具最多可发送四个问题): 问题 1 —“您将使用哪种语言?”英语 → 代码 `en` 法语 → `fr`
构建参数列表: 如果用户选择特定语言,添加 `--language <code>` 始终添加 `--model <chosen_model>` 如果用户选择非默认热键,添加 `--hotkey "<chosen_hotkey>"` 如果用户选择安静/低声选项,添加 `--whisper-mode`
简洁地告诉他们:现在打开一个终端窗口,显示语音模式日志。默认热键:F8(或他们选择的任何键)——按住讲话,松开将转录内容粘贴到聚焦窗口中。为了将文字记录放入 Claude 桌面应用程序中,请在释放热键之前单击聊天输入。 (如果聚焦的窗口标题不包含“Claude”,聚焦安全将阻止粘贴。)首次启动会下载所选的 Whisper 模型(大小取决于选择)。
# Voice mode launcher
This skill gets the user from zero to a running voice-input loop in one go.
It asks the user four quick setup questions (language, model size, hotkey,
voice sensitivity), installs Python deps on first run, and launches the
script as a detached background process.
## Step 1 — Prerequisites
Run these checks. If either fails, tell the user what to install and stop:
```bash
python -c "import sys; assert sys.version_info >= (3,10), f'need 3.10+, have {sys.version}'; print(sys.version)"
```
Needs Python 3.10+. If `python` is not found, try `python3` (macOS/Linux) or `py` (Windows).
If missing: "Install Python 3.10 or newer from python.org, then restart Claude."
```bash
claude --version
```
Needs the Claude CLI. If missing: "Install the Claude CLI first — https://claude.com/claude-code"
## Step 2 — First-run setup (venv + auto-install deps)
Install into a **plugin-local venv**, not the user's system Python. This dodges
PEP 668 on modern Debian/Ubuntu/Fedora (where `pip install --user` is refused),
and keeps faster-whisper's heavy deps isolated so uninstall is just `rm -rf .venv`.
First check whether the venv already exists and has the deps:
```bash
# Windows
"${CLAUDE_PLUGIN_ROOT}/.venv/Scripts/python.exe" -c "import faster_whisper, sounddevice, soundfile, pynput, numpy, yaml" 2>&1
# macOS / Linux
"${CLAUDE_PLUGIN_ROOT}/.venv/bin/python" -c "import faster_whisper, sounddevice, soundfile, pynput, numpy, yaml" 2>&1
```
If the venv doesn't exist, create it (tell the user "Setting up voice mode (one-time, ~200 MB)..."):
```bash
# Windows
python -m venv "${CLAUDE_PLUGIN_ROOT}/.venv"
"${CLAUDE_PLUGIN_ROOT}/.venv/Scripts/python.exe" -m pip install --upgrade pip
"${CLAUDE_PLUGIN_ROOT}/.venv/Scripts/python.exe" -m pip install -r "${CLAUDE_PLUGIN_ROOT}/scripts/requirements.txt"
# macOS / Linux
python3 -m venv "${CLAUDE_PLUGIN_ROOT}/.venv"
"${CLAUDE_PLUGIN_ROOT}/.venv/bin/python" -m pip install --upgrade pip
"${CLAUDE_PLUGIN_ROOT}/.venv/bin/python" -m pip install -r "${CLAUDE_PLUGIN_ROOT}/scripts/requirements.txt"
```
If venv creation itself fails with "ensurepip is not available" on Debian/Ubuntu,
the user needs `sudo apt install python3-venv`. Surface that hint and stop.
If install itself fails, surface the error and stop.
## Step 3 — Ask the user for language, model, and hotkey
Use **AskUserQuestion** with these FOUR questions (send all four in one call
for a single round-trip — four is the AskUserQuestion tool maximum):
**Question 1 — "What language will you be speaking?"**
- **English** → code `en`
- **French** → `fr`
- **Spanish** → `es`
- **German** → `de`
- **Italian** → `it`
- **Portuguese** → `pt`
- **Japanese** → `ja`
- **Chinese** → `zh`
- **Auto-detect** → leave blank (works but less reliable on short clips)
- **Other** → ask for the ISO 639-1 code (e.g. `ru`, `nl`, `ko`, `ar`, `hi`)
**Question 2 — "Which Whisper model size?"** Include a short description so
the user can choose:
- **tiny** (~75 MB) — Fastest, roughest accuracy. English keywords or quick tests only.
- **base** (~150 MB) — Fast, OK English, poor for other languages.
- **small** (~500 MB) — **Recommended.** Sweet spot: good accuracy in most languages, runs on CPU.
- **medium** (~1.5 GB) — High accuracy but slow on CPU. Good if you have time or a GPU.
- **large-v3** (~3 GB) — Near-human accuracy. Needs an NVIDIA GPU to be usable.
**Question 3 — "Which hotkey should trigger recording?"**
- **F8** → `<f8>` (**Recommended** — single key, no chord, rarely conflicts)
- **F9** → `<f9>`
- **Ctrl + Shift + Space** → `<ctrl>+<shift>+<space>` (may clash with IMEs or Discord push-to-talk on some setups)
- **Ctrl + Shift + V** → `<ctrl>+<shift>+<v>`
- **Other** → ask the user for a pynput hotkey string (each key in angle brackets, plus-separated, e.g. `<ctrl>+<alt>+<v>`)
Do NOT offer Right Alt as an option on Windows. Many keyboard layouts remap
Right Alt to AltGr, which Windows emits as a synthetic Ctrl+Alt combo —
pynput sees two keys and the hotkey never resolves.
**Question 4 — "How do you usually speak when recording?"**
This picks between the default transcription pipeline and the `whisper_mode`
preset, which boosts mic gain and relaxes VAD/Whisper thresholds so quiet
speech doesn't get dropped as silence.
- **Normal speaking voice** → default (no `--whisper-mode` flag)
- **Quietly or whispered** → enable (`--whisper-mode`)
- **Not sure** → default
Defaults if the user skips: `small` model, auto-detect language, `<f8>` hotkey,
normal speaking voice.
## Step 4 — Launch
Build the arg list:
- If user picked a specific language, add `--language <code>`
- Always add `--model <chosen_model>`
- If user picked a non-default hotkey, add `--hotkey "<chosen_hotkey>"`
- If user picked the quiet/whispered option, add `--whisper-mode`
Spawn DETACHED so it survives this conversation:
Use the **venv's** python (created in Step 2), not the system python.
**Windows:** Use PowerShell `Start-Process` with an **array** argument list so paths with spaces or unicode (OneDrive, accented usernames) don't blow up the quoting:
```bash
powershell -NoProfile -Command "Start-Process -FilePath '${CLAUDE_PLUGIN_ROOT}/.venv/Scripts/python.exe' -WorkingDirectory '${CLAUDE_PLUGIN_ROOT}' -ArgumentList @('${CLAUDE_PLUGIN_ROOT}/scripts/claude_voice.py', <each-flag-as-its-own-quoted-element>)"
```
Example with `--language fr --model small`:
```bash
powershell -NoProfile -Command "Start-Process -FilePath '${CLAUDE_PLUGIN_ROOT}/.venv/Scripts/python.exe' -WorkingDirectory '${CLAUDE_PLUGIN_ROOT}' -ArgumentList @('${CLAUDE_PLUGIN_ROOT}/scripts/claude_voice.py', '--language', 'fr', '--model', 'small')"
```
**macOS / Linux:**
```bash
nohup "${CLAUDE_PLUGIN_ROOT}/.venv/bin/python" "${CLAUDE_PLUGIN_ROOT}/scripts/claude_voice.py" <flags> > /dev/null 2>&1 &
```
## Step 5 — Confirm to the user
Tell them concisely:
- A terminal window is now open showing voice-mode logs.
- Default hotkey: **F8** (or whatever they picked) — hold to talk, release to paste the transcript into the focused window.
- For the transcript to land in the Claude Desktop App, click into the chat input before releasing the hotkey. (Focus safety will block paste if the focused window title doesn't contain "Claude".)
- First launch downloads the chosen Whisper model (size depends on choice).
- To stop it: close the terminal window, or kill the python process.
Do NOT try to read the script's output — it runs independently.
---
> Source: [AfterRealm/claude-voice](https://github.com/AfterRealm/claude-voice) — distributed by [TomeVault](https://tomevault.io).
<!-- tomevault:4.0:skill_md:2026-05-22 -->
按说明文件中的顺序排列。
第 1 步 — 先决条件
第 2 步 — 首次运行设置(venv + 自动安装 deps)
第 3 步 — 询问用户语言、型号和热键
第 4 步 — 启动
第 5 步 — 向用户确认
文件/命令 -> python · python3 · pip install --user · rm -rf .venv · sudo apt install python3-venv · <f8> · <f9> · <ctrl>+<shift>+<space>
内容校验值 -> a6ba59dea291
当前原文的自动摘译,尚未人工审校。
第 4 步 — 启动
构建参数列表:如果用户选择了特定语言,请添加
--language <code>始终添加--model <chosen_model>如果用户选择了非默认热键,请添加--hotkey "<chosen_hotkey>"如果用户选择了安静/耳语选项,请添加--whisper-mode