Install
openclaw skills install tts-autoplayAuto-play TTS voice files with wake word detection. Only plays audio when user message contains wake words like "语音", "念出来", "voice", etc. Perfect for Webchat users who want conditional voice responses.
openclaw skills install tts-autoplayAutomatically play TTS voice files only when wake words are detected in user messages.
Edit ~/.openclaw/openclaw.json:
{
"messages": {
"tts": {
"auto": "tagged", // Changed from "always"
"provider": "edge",
"edge": {
"enabled": true,
"voice": "zh-CN-XiaoxiaoNeural",
"lang": "zh-CN"
}
}
}
}
# Install skill
clawhub install tts-autoplay
cd skills/tts-autoplay
# Install
powershell -ExecutionPolicy Bypass -File install.ps1
# Start with wake word detection
powershell -ExecutionPolicy Bypass -File tts-autoplay-wakeword.ps1
Text-only (default):
你:今天天气怎么样?
AI: [文字] 今天杭州晴朗...
Voice (with wake word):
你:用语音告诉我天气
AI: [语音] 今天杭州晴朗...
TTS only generates audio when [[tts]] tag is present.
Config:
{ "messages": { "tts": { "auto": "tagged" } } }
AI Behavior:
[[tts]] tag to responseTTS always generates audio for every response.
Config:
{ "messages": { "tts": { "auto": "always" } } }
Script Behavior:
Edit tts-autoplay-wakeword.ps1:
$wakeWords = @(
"语音",
"念出来",
"读出来",
"你的自定义词" # Add your own
)
Keyword mode (default):
# Matches if any wake word appears in filename
if ($fileName -match $word) { ... }
Exact mode:
# Only matches exact directory names
if ($file.Directory.Name -eq $word) { ... }
# Disable voice at night
$hour = (Get-Date).Hour
if ($hour -lt 8 -or $hour -ge 23) {
Write-Log "Night mode: Voice disabled"
return
}
tts-autoplay/
├── SKILL.md # Skill metadata
├── README.md # This file
├── WAKE-WORD-DESIGN.md # Wake word design doc
├── tts-autoplay.ps1 # Basic auto-play (v1.0)
├── tts-autoplay-wakeword.ps1 # With wake word (v2.0)
├── install.ps1 # Installation script
├── uninstall.ps1 # Uninstallation script
├── start.bat # Windows launcher
└── examples/
└── config-example.json # Config examples
Without wake word:
User: 今天天气如何?
AI: [Text only] 今天杭州晴朗,气温 25 度。
With wake word:
User: 用语音告诉我天气
AI: [Voice] 今天杭州晴朗,气温 25 度。
User: 念一下今天的新闻
AI: [Voice] 好的,今天的主要新闻有...
User: 讲个故事给我听
AI: [Voice] 从前有座山...
Issue: Wake word detection not working
Solution:
tts-autoplay-wakeword.ps1 (not basic version)Issue: Wake words not detected
Solution:
tagged mode[[tts]] tagsError: Execution Policy
Solution:
powershell -ExecutionPolicy Bypass -File "tts-autoplay-wakeword.ps1"
| Feature | v1.0 (Always) | v2.0 (Wake Word) |
|---|---|---|
| Voice on every message | ✅ | ❌ |
| Wake word detection | ❌ | ✅ |
| Text-only mode | ❌ | ✅ |
| Configurable triggers | ❌ | ✅ |
| Battery friendly | ❌ | ✅ |
| Best for | Testing/Demo | Daily use |
$wakeWords = @{
'zh-CN' = @('语音', '念出来', '读出来')
'en-US' = @('voice', 'speak', 'read it')
'ja-JP' = @('音声', '読んで')
}
# Only enable voice for specific topics
if ($userMessage -match '新闻 | 故事 | 文章') {
$enableVoice = $true
}
# Load user-specific wake words
$config = Get-Content "user-config.json" | ConvertFrom-Json
$wakeWords = $config.wakeWords
MIT License
Enjoy smart voice playback! 🎉
For detailed wake word design, see WAKE-WORD-DESIGN.md.