voice-output
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseVoice Output Skill
语音输出Skill
Convert text to speech and speak it aloud using system TTS or browser TTS.
使用系统TTS或浏览器TTS将文本转换为语音并朗读出来。
Setup
设置
No additional setup required. Uses built-in system commands:
- macOS: command (built-in)
say - Linux: or
espeak(install viafestival)apt install espeak - Browser: Web Speech API via Chrome DevTools Protocol
无需额外设置。使用内置系统命令:
- macOS:命令(内置)
say - Linux:或
espeak(通过festival安装)apt install espeak - 浏览器:通过Chrome DevTools Protocol调用Web Speech API
Usage
使用方法
Speak text via system TTS (say command)
通过系统TTS朗读文本(say命令)
bash
{baseDir}/scripts/speak.sh "Hello, the job has completed successfully!"bash
{baseDir}/scripts/speak.sh "Hello, the job has completed successfully!"Speak via browser TTS (requires Chrome with CDP)
通过浏览器TTS朗读(需要支持CDP的Chrome)
bash
{baseDir}/scripts/speak-browser.js "Hello from the browser!"bash
{baseDir}/scripts/speak-browser.js "Hello from the browser!"List available voices (browser)
列出可用语音(浏览器端)
bash
{baseDir}/scripts/list-voices.jsbash
{baseDir}/scripts/list-voices.jsVoice Options
语音选项
System voices (macOS)
系统语音(macOS)
List available voices:
bash
say -v "?" Use a specific voice:
bash
{baseDir}/scripts/speak.sh "Hello" --voice "Samantha"Adjust speech rate:
bash
{baseDir}/scripts/speak.sh "Hello" --rate 200列出可用语音:
bash
say -v "?" 使用特定语音:
bash
{baseDir}/scripts/speak.sh "Hello" --voice "Samantha"调整语速:
bash
{baseDir}/scripts/speak.sh "Hello" --rate 200Browser voices
浏览器语音
The browser TTS uses Web Speech API with available system voices. Default is usually the best available voice.
浏览器TTS使用Web Speech API,调用系统可用语音。默认通常使用最佳可用语音。
Trigger Patterns
触发场景
Use this skill when:
- User asks "say", "speak", "read aloud", "text to speech"
- Job completes and you want to announce success/failure
- User wants notifications spoken rather than just displayed
- Accessibility - reading content aloud for visually impaired users
- Creating audio summaries or reports
在以下场景使用此Skill:
- 用户提出“朗读”“播报”“大声读出来”“文本转语音”等需求
- 任务完成后需要播报成功/失败状态
- 用户希望通过语音而非仅显示方式接收通知
- 无障碍功能——为视障用户朗读内容
- 创建音频摘要或报告
Examples
示例
Announce job completion
播报任务完成
bash
{baseDir}/scripts/speak.sh "Job complete! Processed 50 files, found 3 issues."bash
{baseDir}/scripts/speak.sh "Job complete! Processed 50 files, found 3 issues."Read a summary
朗读摘要
bash
{baseDir}/scripts/speak.sh "Summary: Four files were modified, two tests added."bash
{baseDir}/scripts/speak.sh "Summary: Four files were modified, two tests added."Browser TTS (when Chrome is available)
浏览器TTS(当Chrome可用时)
bash
{baseDir}/scripts/speak-browser.js "Speaking directly through the browser!"bash
{baseDir}/scripts/speak-browser.js "Speaking directly through the browser!"Notes
注意事项
- System TTS () works on macOS out of the box
say - On Linux, install espeak:
sudo apt install espeak - Browser TTS requires Chrome running with remote debugging (see browser-tools skill)
- Both methods are synchronous - the command blocks until speech completes
- For non-blocking speech, add at the end of the command
&
- 系统TTS()在macOS上可直接使用
say - 在Linux上,需安装espeak:
sudo apt install espeak - 浏览器TTS需要Chrome开启远程调试(详见browser-tools skill)
- 两种方式均为同步执行——命令会阻塞直到语音播放完成
- 如需非阻塞语音播放,在命令末尾添加
&