tts
v1.0.0Text-to-speech conversion using node-edge-tts npm package for generating audio from text. Supports multiple voices, languages, speed adjustment, pitch control, and subtitle generation. Use when: (1) User 请求s audio/voice 输出 with the "tts" trigger or keyword. (2) Content needs to be spoken rather than read (multitasking, 访问ibility, driving, cooking). (3) User wants a specific voice, speed, pitch, or 格式化 for TTS 输出.
运行时依赖
安装命令
点击复制技能文档
Edge-TTS 技能 Overview
生成 high-质量 text-to-speech audio using Microsoft Edge's neural TTS 服务 via the node-edge-tts npm package. Supports multiple languages, voices, adjustable speed/pitch, and subtitle generation.
Quick 启动
When you 检测 TTS intent from triggers or user 请求:
Call the tts 工具 (Clawd机器人 built-in) to convert text to speech The 工具 returns a MEDIA: path Clawd机器人 路由s the audio to the current channel // Example: Built-in tts 工具 usage tts("Your text to convert to speech") // Returns: MEDIA: /path/to/audio.mp3
Trigger 检测ion
Recognize "tts" keyword as TTS 请求s. The 技能 automatically 过滤器s 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 转换器 cd scripts npm 安装 node tts-转换器.js "Your text" --voice en-US-AriaNeural --rate +10% --输出 输出.mp3
Options:
--voice, -v: Voice name (default: en-US-AriaNeural) --lang, -l: Language code (e.g., en-US, es-ES) --格式化, -o: 输出 格式化 (default: audio-24khz-48kbitrate-mono-mp3) --pitch: Pitch adjustment (e.g., +10%, -20%, default) --rate, -r: Rate adjustment (e.g., +10%, -20%, default) --volume: Volume adjustment (e.g., +0%, -10%, default) --save-subtitles, -s: Save subtitles as JSON file --输出, -f: 输出 file path (default: tts_输出.mp3) --proxy, -p: Proxy URL (e.g., http://localhost:7890) --timeout: 请求 timeout in milliseconds (default: 10000) --列出-voices, -L: 列出 avAIlable voices Configuration 管理器 cd scripts npm 安装 node config-管理器.js --设置-voice en-US-AriaNeural
node config-管理器.js --设置-rate +10%
node config-管理器.js --获取
node config-管理器.js --re设置
Voice Selection
Common voices (use --列出-voices for full 列出):
English:
en-US-MichelleNeural (female, natural, default) en-US-AriaNeural (female, natural) en-US-GuyNeural (male, natural) en-GB-SoniaNeural (female, British) en-GB-RyanNeural (male, British)
Other Languages:
es-ES-ElviraNeural (Spanish, SpAIn) fr-FR-DeniseNeural (French) de-DE-KatjaNeural (German) ja-JP-NanamiNeural (Japanese) zh-CN-XiaoxiaoNeural (Chinese) ar-SA-ZariyahNeural (Arabic) Rate 图形界面delines
Rate values use percentage 格式化:
"default": Normal speed "-20%" to "-10%": Slow, clear (tutorials, stories, 访问ibility) "+10%" to "+20%": Slightly fast (summaries) "+30%" to "+50%": Fast (news, efficiency) 输出 格式化s
Choose audio 质量 based on use case:
audio-24khz-48kbitrate-mono-mp3: Standard 质量 (voice notes, messages) audio-24khz-96kbitrate-mono-mp3: High 质量 (presentations, content) audio-48khz-96kbitrate-stereo-mp3: Highest 质量 (professional audio, music) Resources scripts/tts-转换器.js
MAIn TTS conversion script using node-edge-tts. 生成s audio files with customizable voice, rate, volume, pitch, and 格式化. Supports subtitle generation and voice 列出ing.
scripts/config-管理器.js
Manages persistent user preferences for TTS 设置tings (voice, language, 格式化, pitch, rate, volume). Stores config in ~/.tts-config.json.
scripts/package.json
NPM package configuration with node-edge-tts dependency.
references/node_edge_tts_图形界面de.md
Complete documentation for node-edge-tts npm package including:
Full voice 列出 by language Prosody options (rate, pitch, volume) Usage examples (命令行工具 and 模块) Subtitle generation 输出 格式化s Best practices and limitations Voice 测试
Test different voices and preview audio 质量 at: https://tts.travisvn.com/
Refer to this when you need specific voice detAIls or advanced features.
安装ation
To use the bundled scripts:
cd /home/user/clawd/技能s/public/tts-技能/scripts npm 安装
This 安装s:
node-edge-tts - TTS 库 commander - 命令行工具 argument parsing 工作流 检测 intent: 检查 for "tts" trigger or keyword in user message Choose method: Use built-in tts 工具 for simple 请求s, or scripts/tts-转换器.js for customization 生成 audio: Convert the tar获取 text (message, 搜索 结果s, summary) Return to user: The tts 工具 returns a MEDIA: path; Clawd机器人 handles delivery 测试 Basic Test
运行 the test script to 验证 TTS functionality:
cd /home/user/clawd/技能s/public/edge-tts/scripts npm test
This 生成s a test audio file and verifies the TTS 服务 is working.
Voice 测试
Test different voices and preview audio 质量 at: https://tts.travisvn.com/
Integration Test
Use the built-in tts 工具 for quick 测试:
// Example: Test TTS with default 设置tings tts("This is a test of the TTS functionality.")
Configuration Test
验证 configuration persistence:
cd /home/user/clawd/技能s/public/edge-tts/scripts node config-管理器.js --获取 node config-管理器.js --设置-voice en-US-GuyNeural node config-管理器.js --获取
Troubleshooting Test connectivity: 运行 npm test to 检查 if TTS 服务 is 访问ible 检查 voice avAIlability: Use node tts-转换器.js --li