Skills edge-tts
git clone https://github.com/openclaw/skills
T=$(mktemp -d) && git clone --depth=1 https://github.com/openclaw/skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/17854566382/tts-1" ~/.claude/skills/openclaw-skills-edge-tts && rm -rf "$T"
T=$(mktemp -d) && git clone --depth=1 https://github.com/openclaw/skills "$T" && mkdir -p ~/.openclaw/skills && cp -r "$T/skills/17854566382/tts-1" ~/.openclaw/skills/openclaw-skills-edge-tts && rm -rf "$T"
skills/17854566382/tts-1/SKILL.mdEdge-TTS Skill
Overview
Generate high-quality text-to-speech audio using Microsoft Edge's neural TTS service via the node-edge-tts npm package. Supports multiple languages, voices, adjustable speed/pitch, and subtitle generation.
Quick Start
When you detect TTS intent from triggers or user request:
- Call the tts tool (Clawdbot built-in) to convert text to speech
- The tool returns a MEDIA: path
- Clawdbot routes the audio to the current channel
// Example: Built-in tts tool usage tts("Your text to convert to speech") // Returns: MEDIA: /path/to/audio.mp3
Trigger Detection
Recognize "tts" keyword as TTS requests. The skill automatically filters out TTS-related keywords from text before conversion to avoid converting the trigger words themselves to audio.
Advanced Customization
Using the Node.js Scripts
For more control, use the bundled scripts directly:
TTS Converter
cd scripts npm install node tts-converter.js "Your text" --voice en-US-AriaNeural --rate +10% --output output.mp3
Options:
: Voice name (default: en-US-AriaNeural)--voice, -v
: Language code (e.g., en-US, es-ES)--lang, -l
: Output format (default: audio-24khz-48kbitrate-mono-mp3)--format, -o
: Pitch adjustment (e.g., +10%, -20%, default)--pitch
: Rate adjustment (e.g., +10%, -20%, default)--rate, -r
: Volume adjustment (e.g., +0%, -10%, default)--volume
: Save subtitles as JSON file--save-subtitles, -s
: Output file path (default: tts_output.mp3)--output, -f
: Proxy URL (e.g., http://localhost:7890)--proxy, -p
: Request timeout in milliseconds (default: 10000)--timeout
: List available voices--list-voices, -L
Configuration Manager
cd scripts npm install node config-manager.js --set-voice en-US-AriaNeural node config-manager.js --set-rate +10% node config-manager.js --get node config-manager.js --reset
Voice Selection
Common voices (use
--list-voices for full list):
English:
(female, natural, default)en-US-MichelleNeural
(female, natural)en-US-AriaNeural
(male, natural)en-US-GuyNeural
(female, British)en-GB-SoniaNeural
(male, British)en-GB-RyanNeural
Other Languages:
(Spanish, Spain)es-ES-ElviraNeural
(French)fr-FR-DeniseNeural
(German)de-DE-KatjaNeural
(Japanese)ja-JP-NanamiNeural
(Chinese)zh-CN-XiaoxiaoNeural
(Arabic)ar-SA-ZariyahNeural
Rate Guidelines
Rate values use percentage format:
: Normal speed"default"
to"-20%"
: Slow, clear (tutorials, stories, accessibility)"-10%"
to"+10%"
: Slightly fast (summaries)"+20%"
to"+30%"
: Fast (news, efficiency)"+50%"
Output Formats
Choose audio quality based on use case:
: Standard quality (voice notes, messages)audio-24khz-48kbitrate-mono-mp3
: High quality (presentations, content)audio-24khz-96kbitrate-mono-mp3
: Highest quality (professional audio, music)audio-48khz-96kbitrate-stereo-mp3
Resources
scripts/tts-converter.js
Main TTS conversion script using node-edge-tts. Generates audio files with customizable voice, rate, volume, pitch, and format. Supports subtitle generation and voice listing.
scripts/config-manager.js
Manages persistent user preferences for TTS settings (voice, language, format, pitch, rate, volume). Stores config in
~/.tts-config.json.
scripts/package.json
NPM package configuration with node-edge-tts dependency.
references/node_edge_tts_guide.md
Complete documentation for node-edge-tts npm package including:
- Full voice list by language
- Prosody options (rate, pitch, volume)
- Usage examples (CLI and Module)
- Subtitle generation
- Output formats
- Best practices and limitations
Voice Testing
Test different voices and preview audio quality at: https://tts.travisvn.com/
Refer to this when you need specific voice details or advanced features.
Installation
To use the bundled scripts:
cd /home/user/clawd/skills/public/tts-skill/scripts npm install
This installs:
- TTS librarynode-edge-tts
- CLI argument parsingcommander
Workflow
- Detect intent: Check for "tts" trigger or keyword in user message
- Choose method: Use built-in
tool for simple requests, ortts
for customizationscripts/tts-converter.js - Generate audio: Convert the target text (message, search results, summary)
- Return to user: The tts tool returns a MEDIA: path; Clawdbot handles delivery
Testing
Basic Test
Run the test script to verify TTS functionality:
cd /home/user/clawd/skills/public/edge-tts/scripts npm test
This generates a test audio file and verifies the TTS service is working.
Voice Testing
Test different voices and preview audio quality at: https://tts.travisvn.com/
Integration Test
Use the built-in
tts tool for quick testing:
// Example: Test TTS with default settings tts("This is a test of the TTS functionality.")
Configuration Test
Verify configuration persistence:
cd /home/user/clawd/skills/public/edge-tts/scripts node config-manager.js --get node config-manager.js --set-voice en-US-GuyNeural node config-manager.js --get
Troubleshooting
- Test connectivity: Run
to check if TTS service is accessiblenpm test - Check voice availability: Use
to see available voicesnode tts-converter.js --list-voices - Verify proxy settings: If using proxy, test with
node tts-converter.js "test" --proxy http://localhost:7890 - Check audio output: The test should generate
in the scripts directorytest-output.mp3
Notes
- node-edge-tts uses Microsoft Edge's online TTS service (updated, working authentication)
- No API key needed (free service)
- Output is MP3 format by default
- Requires internet connection
- Supports subtitle generation (JSON format with word-level timing)
- Temporary File Handling: By default, audio files are saved to the system's temporary directory (
on Unix,/tmp/edge-tts-temp/
on Windows) with unique filenames (e.g.,C:\Users\<user>\AppData\Local\Temp\edge-tts-temp\
). Files are not automatically deleted - the calling application (Clawdbot) should handle cleanup after use. You can specify a custom output path with thetts_1234567890_abc123.mp3
option if permanent storage is needed.--output - TTS keyword filtering: The skill automatically filters out TTS-related keywords (tts, TTS, text-to-speech) from text before conversion to avoid converting the trigger words themselves to audio
- For repeated preferences, use
to set defaultsconfig-manager.js - Default voice:
(female, natural)en-US-MichelleNeural - Neural voices (ending in
) provide higher quality than Standard voicesNeural