Edge-TTS Skill
Overview
Generate high-quality text-to-speech audio using Microsoft Edge's neural TTS service via Python edge-tts. Supports multiple languages, voices, adjustable speed/pitch, and subtitle generation (SRT/VTT).
Quick Start
When you detect TTS intent from triggers or user request:
- 1. 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
Trigger Detection
Recognize "tts" keyword as TTS requests. The skill automatically filters out TTS-related keywords from text before conversion.
Advanced Customization
Using the Python Scripts
For more control, use the bundled scripts directly:
TTS Converter
CODEBLOCK0
Options:
- -
--voice, -v: Voice name (default: en-US-MichelleNeural) - INLINECODE1 : Language code (e.g., en-US, zh-CN)
- INLINECODE2 : Rate adjustment (e.g., +10%, -20%)
- INLINECODE3 : Volume adjustment (e.g., +0%, -50%)
- INLINECODE4 : Pitch adjustment (e.g., +0Hz, -10Hz)
- INLINECODE5 : Output file path (default: temp file)
- INLINECODE6 : Save subtitles to file (.vtt or .srt)
- INLINECODE7 : Read text from file
- INLINECODE8 : Proxy URL
- INLINECODE9 : Receive timeout in seconds (default: 60)
- INLINECODE10 : List available voices
- INLINECODE11 : Filter voices by language (used with --list-voices)
Configuration Manager
CODEBLOCK1
Voice Selection
Common voices (use --list-voices for full list):
English:
- -
en-US-MichelleNeural (female, natural, default) - INLINECODE14 (female, natural)
- INLINECODE15 (male, natural)
- INLINECODE16 (female, British)
- INLINECODE17 (male, British)
Chinese:
- -
zh-CN-XiaoxiaoNeural (female) - INLINECODE19 (male, news style)
- INLINECODE20 (male, natural)
Other Languages:
- -
es-ES-ElviraNeural (Spanish) - INLINECODE22 (French)
- INLINECODE23 (German)
- INLINECODE24 (Japanese)
- INLINECODE25 (Arabic)
Rate Guidelines
Rate values use percentage format:
- -
"+0%": Normal speed (default) - INLINECODE27 to
"-10%": Slow, clear (tutorials, stories, accessibility) - INLINECODE29 to
"+20%": Slightly fast (summaries) - INLINECODE31 to
"+50%": Fast (news, efficiency)
Resources
scripts/tts_converter.py
Main TTS conversion script using edge-tts. Generates audio files with customizable voice, rate, volume, pitch. Supports subtitle generation (VTT/SRT) and voice listing.
scripts/config_manager.py
Manages persistent user preferences for TTS settings. Stores config in
~/.tts-config.json.
Voice Testing
Test different voices and preview audio quality at: https://tts.travisvn.com/
Installation
CODEBLOCK2
Workflow
- 1. Detect intent: Check for "tts" trigger or keyword in user message
- Choose method: Use built-in
tts tool for simple requests, or scripts/tts_converter.py for customization - Generate audio: Convert the target text
- Return to user: The tts tool returns a MEDIA: path; Clawdbot handles delivery
Testing
Basic Test
CODEBLOCK3
Chinese Test
CODEBLOCK4
List Voices
CODEBLOCK5
Configuration Test
CODEBLOCK6
Notes
- - edge-tts uses Microsoft Edge's online TTS service
- No API key needed (free service)
- Output is MP3 format by default
- Requires internet connection
- Supports subtitle generation (standard VTT/SRT format)
- Temporary File Handling: By default, audio files are saved to the system's temporary directory with unique filenames. Specify a custom output path with
--output for permanent storage. - TTS keyword filtering: Automatically filters out TTS-related keywords from text before conversion
- Neural voices (ending in
Neural) provide higher quality