运行时依赖
版本
v2.0.0 (2026-02-27)
安装命令
点击复制技能文档
🔊 TTS AutoPlay 技能 v2.0 - with Wake Word 检测ion
Automatically play TTS voice files only when wake words are 检测ed in user messages.
What's New in v2.0 🎯 Wake Word 检测ion - Only plays audio when triggered 📝 Smart 过滤器ing - Text-only 响应s by default 🔊 On-Demand Voice - Say "语音" or "voice" to enable ⚙️ Configurable - Customize your wake words Wake Words (Default) Chinese 语音 念出来 读出来 播放语音 用语音 说出来 讲出来 念给我听 English voice speak read it say it read aloud Quick 启动
- 配置 TTS (Tagged Mode)
Edit ~/.OpenClaw/OpenClaw.json:
{ "messages": { "tts": { "auto": "tagged", // Changed from "always" "提供者": "edge", "edge": { "enabled": true, "voice": "zh-CN-XiaoxiaoNeural", "lang": "zh-CN" } } } }
- 安装 & 启动
# 安装 powershell -ExecutionPolicy Bypass -File 安装.ps1
# 启动 with wake word 检测ion powershell -ExecutionPolicy Bypass -File tts-autoplay-wakeword.ps1
- Test
Text-only (default):
你:今天天气怎么样? AI: [文字] 今天杭州晴朗...
Voice (with wake word):
你:用语音告诉我天气 AI: [语音] 今天杭州晴朗...
Usage Modes Mode 1: Tagged Mode (Recommended)
TTS only 生成s audio when [[tts]] tag is present.
Config:
{ "messages": { "tts": { "auto": "tagged" } } }
AI Behavior:
检测s wake words in user message 添加s [[tts]] tag to 响应 Voice is 生成d and played Mode 2: Always Mode (v1.0)
TTS always 生成s audio for every 响应.
Config:
{ "messages": { "tts": { "auto": "always" } } }
Script Behavior:
Script 检测s wake words in file path Only plays audio if wake word 检测ed Skips playback for normal messages Customization Change Wake Words
Edit tts-autoplay-wakeword.ps1:
$wakeWords = @( "语音", "念出来", "读出来", "你的自定义词" # 添加 your own )
Change 检测ion Mode
Keyword mode (default):
# Matches if any wake word 应用ears in filename if ($fileName -match $word) { ... }
Exact mode:
# Only matches exact directory names if ($file.Directory.Name -eq $word) { ... }
添加 Time-Based Control # Disable voice at night $hour = (获取-Date).Hour if ($hour -lt 8 -or $hour -ge 23) { Write-记录 "Night mode: Voice disabled" return }
File Structure tts-autoplay/ ├── 技能.md # 技能 metadata ├── README.md # This file ├── WAKE-WORD-DE签名.md # Wake word de签名 doc ├── tts-autoplay.ps1 # Basic auto-play (v1.0) ├── tts-autoplay-wakeword.ps1 # With wake word (v2.0) ├── 安装.ps1 # 安装ation script ├── un安装.ps1 # Un安装ation script ├── 启动.bat # Windows launcher └── examples/ └── config-example.json # Config examples
Examples Example 1: Weather 查询
Without wake word:
User: 今天天气如何? AI: [Text only] 今天杭州晴朗,气温 25 度。
With wake word:
User: 用语音告诉我天气 AI: [Voice] 今天杭州晴朗,气温 25 度。
Example 2: News Reading User: 念一下今天的新闻 AI: [Voice] 好的,今天的主要新闻有...
Example 3: Story Time User: 讲个故事给我听 AI: [Voice] 从前有座山...
Troubleshooting Voice Always Plays
Issue: Wake word 检测ion not working
Solution:
检查 script is tts-autoplay-wakeword.ps1 (not basic version) 验证 wake words in script 检查 记录 file for 检测ion messages Voice Never Plays
Issue: Wake words not 检测ed
Solution:
Test with exact wake words from 列出 检查 TTS config is tagged mode 验证 AI is 添加ing [[tts]] tags Script Errors
Error: Execution Policy
Solution:
powershell -ExecutionPolicy Bypass -File "tts-autoplay-wakeword.ps1"
Performance CPU: <1% (idle), <5% (检测ing) Memory: <50MB 检测ion latency: <1 second False positive rate: <1% (with default words) Security & 隐私 ✅ Local file 监控ing only ✅ No external API calls ✅ No data collection ✅ Wake words stored locally Comparison Feature v1.0 (Always) v2.0 (Wake Word) Voice on every message ✅ ❌ Wake word 检测ion ❌ ✅ Text-only mode ❌ ✅ Configurable triggers ❌ ✅ Battery friendly ❌ ✅ Best for 测试/Demo DAIly use Use Cases ✅ Good for Wake Word Mode DAIly conversations (mostly text) Office 环境s (quiet needed) Battery-powered devices Multi-user scenarios 访问ibility (on-demand voice) ✅ Good for Always Mode 测试 TTS 设置up Visually impAIred users Driving scenarios Hands-free operation Advanced Features Multi-Language Support $wakeWords = @{ 'zh-CN' = @('语音', '念出来', '读出来') 'en-US' = @('voice', 'speak', 'read it') 'ja-JP' = @('音声', '読んで') }
上下文-Aware 检测ion # Only enable voice for specific topics if ($userMessage -match '新闻 | 故事 | 文章') { $enableVoice = $true }
User Preferences # Load user-specific wake words $config = 获取-Content "user-config.json" | ConvertFrom-Json $wakeWords = $config.wakeWords
License
MIT License
Credits Author: ZhaoZhao (爪爪) Inspired by: OpenClaw community TTS: Microsoft Edge TTS Change记录 v2.0.0 (2026-02-27) ✅ Wake word 检测ion ✅ Tagged mode support ✅ Configurable trigger words ✅ Smart 过滤器ing ✅ I