{"skill":{"slug":"edge-tts","displayName":"Edge TTS","summary":"Text-to-speech conversion using node-edge-tts npm package for generating audio from text.\nSupports multiple voices, languages, speed adjustment, pitch control, and subtitle generation.\nUse when: (1) User requests audio/voice output with the \"tts\" trigger or keyword. (2) Content needs to be spoken rather than read (multitasking, accessibility, driving, cooking). (3) User wants a specific voice, speed, pitch, or format for TTS output.","description":"---\nname: edge-tts\ndescription: |\n  Text-to-speech conversion using node-edge-tts npm package for generating audio from text.\n  Supports multiple voices, languages, speed adjustment, pitch control, and subtitle generation.\n  Use when: (1) User requests audio/voice output with the \"tts\" trigger or keyword. (2) Content needs to be spoken rather than read (multitasking, accessibility, driving, cooking). (3) User wants a specific voice, speed, pitch, or format for TTS output.\n---\n\n# Edge-TTS Skill\n\n## Overview\n\nGenerate 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.\n\n## Quick Start\n\nWhen you detect TTS intent from triggers or user request:\n\n1. **Call the tts tool** (Clawdbot built-in) to convert text to speech\n2. The tool returns a MEDIA: path\n3. Clawdbot routes the audio to the current channel\n\n```javascript\n// Example: Built-in tts tool usage\ntts(\"Your text to convert to speech\")\n// Returns: MEDIA: /path/to/audio.mp3\n```\n\n## Trigger Detection\n\nRecognize \"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.\n\n## Advanced Customization\n\n### Using the Node.js Scripts\n\nFor more control, use the bundled scripts directly:\n\n#### TTS Converter\n```bash\ncd scripts\nnpm install\nnode tts-converter.js \"Your text\" --voice en-US-AriaNeural --rate +10% --output output.mp3\n```\n\n**Options:**\n- `--voice, -v`: Voice name (default: en-US-AriaNeural)\n- `--lang, -l`: Language code (e.g., en-US, es-ES)\n- `--format, -o`: Output format (default: audio-24khz-48kbitrate-mono-mp3)\n- `--pitch`: Pitch adjustment (e.g., +10%, -20%, default)\n- `--rate, -r`: Rate adjustment (e.g., +10%, -20%, default)\n- `--volume`: Volume adjustment (e.g., +0%, -10%, default)\n- `--save-subtitles, -s`: Save subtitles as JSON file\n- `--output, -f`: Output file path (default: tts_output.mp3)\n- `--proxy, -p`: Proxy URL (e.g., http://localhost:7890)\n- `--timeout`: Request timeout in milliseconds (default: 10000)\n- `--list-voices, -L`: List available voices\n\n#### Configuration Manager\n```bash\ncd scripts\nnpm install\nnode config-manager.js --set-voice en-US-AriaNeural\n\nnode config-manager.js --set-rate +10%\n\nnode config-manager.js --get\n\nnode config-manager.js --reset\n```\n\n### Voice Selection\n\nCommon voices (use `--list-voices` for full list):\n\n**English:**\n- `en-US-MichelleNeural` (female, natural, **default**)\n- `en-US-AriaNeural` (female, natural)\n- `en-US-GuyNeural` (male, natural)\n- `en-GB-SoniaNeural` (female, British)\n- `en-GB-RyanNeural` (male, British)\n\n**Other Languages:**\n- `es-ES-ElviraNeural` (Spanish, Spain)\n- `fr-FR-DeniseNeural` (French)\n- `de-DE-KatjaNeural` (German)\n- `ja-JP-NanamiNeural` (Japanese)\n- `zh-CN-XiaoxiaoNeural` (Chinese)\n- `ar-SA-ZariyahNeural` (Arabic)\n\n### Rate Guidelines\n\nRate values use percentage format:\n- `\"default\"`: Normal speed\n- `\"-20%\"` to `\"-10%\"`: Slow, clear (tutorials, stories, accessibility)\n- `\"+10%\"` to `\"+20%\"`: Slightly fast (summaries)\n- `\"+30%\"` to `\"+50%\"`: Fast (news, efficiency)\n\n### Output Formats\n\nChoose audio quality based on use case:\n- `audio-24khz-48kbitrate-mono-mp3`: Standard quality (voice notes, messages)\n- `audio-24khz-96kbitrate-mono-mp3`: High quality (presentations, content)\n- `audio-48khz-96kbitrate-stereo-mp3`: Highest quality (professional audio, music)\n\n## Resources\n\n### scripts/tts-converter.js\nMain TTS conversion script using node-edge-tts. Generates audio files with customizable voice, rate, volume, pitch, and format. Supports subtitle generation and voice listing.\n\n### scripts/config-manager.js\nManages persistent user preferences for TTS settings (voice, language, format, pitch, rate, volume). Stores config in `~/.tts-config.json`.\n\n### scripts/package.json\nNPM package configuration with node-edge-tts dependency.\n\n### references/node_edge_tts_guide.md\nComplete documentation for node-edge-tts npm package including:\n- Full voice list by language\n- Prosody options (rate, pitch, volume)\n- Usage examples (CLI and Module)\n- Subtitle generation\n- Output formats\n- Best practices and limitations\n\n### Voice Testing\nTest different voices and preview audio quality at: https://tts.travisvn.com/\n\nRefer to this when you need specific voice details or advanced features.\n\n## Installation\n\nTo use the bundled scripts:\n\n```bash\ncd /home/user/clawd/skills/public/tts-skill/scripts\nnpm install\n```\n\nThis installs:\n- `node-edge-tts` - TTS library\n- `commander` - CLI argument parsing\n\n## Workflow\n\n1. **Detect intent**: Check for \"tts\" trigger or keyword in user message\n2. **Choose method**: Use built-in `tts` tool for simple requests, or `scripts/tts-converter.js` for customization\n3. **Generate audio**: Convert the target text (message, search results, summary)\n4. **Return to user**: The tts tool returns a MEDIA: path; Clawdbot handles delivery\n\n## Testing\n\n### Basic Test\nRun the test script to verify TTS functionality:\n```bash\ncd /home/user/clawd/skills/public/edge-tts/scripts\nnpm test\n```\nThis generates a test audio file and verifies the TTS service is working.\n\n### Voice Testing\nTest different voices and preview audio quality at: https://tts.travisvn.com/\n\n### Integration Test\nUse the built-in `tts` tool for quick testing:\n```javascript\n// Example: Test TTS with default settings\ntts(\"This is a test of the TTS functionality.\")\n```\n\n### Configuration Test\nVerify configuration persistence:\n```bash\ncd /home/user/clawd/skills/public/edge-tts/scripts\nnode config-manager.js --get\nnode config-manager.js --set-voice en-US-GuyNeural\nnode config-manager.js --get\n```\n\n## Troubleshooting\n\n- **Test connectivity**: Run `npm test` to check if TTS service is accessible\n- **Check voice availability**: Use `node tts-converter.js --list-voices` to see available voices\n- **Verify proxy settings**: If using proxy, test with `node tts-converter.js \"test\" --proxy http://localhost:7890`\n- **Check audio output**: The test should generate `test-output.mp3` in the scripts directory\n\n## Notes\n\n- node-edge-tts uses Microsoft Edge's online TTS service (updated, working authentication)\n- No API key needed (free service)\n- Output is MP3 format by default\n- Requires internet connection\n- Supports subtitle generation (JSON format with word-level timing)\n- **Temporary File Handling**: By default, audio files are saved to the system's temporary directory (`/tmp/edge-tts-temp/` on Unix, `C:\\Users\\<user>\\AppData\\Local\\Temp\\edge-tts-temp\\` on Windows) with unique filenames (e.g., `tts_1234567890_abc123.mp3`). Files are not automatically deleted - the calling application (Clawdbot) should handle cleanup after use. You can specify a custom output path with the `--output` option if permanent storage is needed.\n- **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\n- For repeated preferences, use `config-manager.js` to set defaults\n- **Default voice**: `en-US-MichelleNeural` (female, natural)\n- Neural voices (ending in `Neural`) provide higher quality than Standard voices\n","tags":{"latest":"2.0.0"},"stats":{"comments":0,"downloads":20865,"installsAllTime":271,"installsCurrent":270,"stars":32,"versions":2},"createdAt":1769296533444,"updatedAt":1778485848771},"latestVersion":{"version":"2.0.0","createdAt":1769456031010,"changelog":"**Major upgrade with added scripts, configurability, and streamlined TTS triggers**\n\n- Added Node.js scripts for TTS conversion and config management (`tts-converter.js`, `config-manager.js`), with installation and usage instructions.\n- Added resource and reference files, including a complete voice/option guide and install script.\n- Changed TTS intent detection to trigger only on the \"tts\" keyword (removes long trigger phrase lists), and clarified keyword filtering prior to conversion.\n- Expanded documentation with workflow, usage examples, advanced configuration, troubleshooting, and testing instructions.\n- Clarified default voice, output formats, temporary file handling, and recommended voice test site.","license":null},"metadata":null,"owner":{"handle":"i3130002","userId":"s174g0b36b6s6mynzh70wmxp5h885pyw","displayName":"i3130002","image":"https://avatars.githubusercontent.com/u/11602376?v=4"},"moderation":null}