微算力 · API 导航与自营网关
API 接入 EN
未登录登录
✨

微软神经网络语音 一键生成

Edge TTS · v2.0.0
专业技能 安全 S 级 作者 i3130002 公开目录收录
18.2k 下载 29 安装 89k 收藏 329 浏览

简介

基于微软Edge神经网络的免费高质量TTS工具,支持多语言、多音色、语速/音调调节及字幕生成,无需API密钥。

原始描述

Text-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 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.

通过你的 Agent 添加

点「快速安装」复制一段指令,粘给你正在用的 Agent(Claude Code、Codex、OpenClaw 等),它会自己完成安装。

或者手动安装

Claude Codeunzip -o skill.zip -d ~/.claude/skills/edge-tts/
其它 Agent解压到它自己的 skills 目录,目录名用 edge-tts

包里是 SKILL.md 加作者附带的文件,解压后目录名就是技能名。 技能申请的权限由作者决定,装之前请确认它能读什么、能执行什么。

中文使用说明 来自收录源

核心用法

Edge-TTS 利用 Microsoft Edge 在线神经语音合成服务,将文本转为高质量 MP3 音频。用户可通过内置 tts 工具快速调用,或使用 Node.js 脚本实现精细控制。

快速入门:检测到 "tts" 关键词后,调用 tts("文本") 即可生成音频,返回 MEDIA 路径供播放。

高级功能:

  • 多语言支持:覆盖英语、中文、日语、西班牙语、法语等主流语言,提供 100+ 神经音色(如 en-US-MichelleNeural、zh-CN-XiaoxiaoNeural)
  • 语音参数调节:语速(-20% 至 +50%)、音调、音量、输出格式(24kHz/48kHz,单声道/立体声)
  • 字幕生成:支持输出带时间戳的 JSON 字幕文件,便于制作字幕同步内容
  • 配置持久化:通过 config-manager.js 保存用户偏好至 ~/.tts-config.json

显著优点

  1. 零成本零门槛:无需 API Key,完全免费使用微软 Edge 神经 TTS 服务,音质优于传统语音合成
  2. 开箱即用:内置工具一键调用,脚本层提供完整 CLI 接口,满足从 casual 到 professional 的全场景需求
  3. 高度可定制:音素级参数控制 + 多格式输出,适配播客、有声书、语音助手、内容无障碍等多种场景
  4. 隐私合规:仅本地存储配置偏好,符合 GDPR 最小化原则

潜在缺点与局限性

  1. 强制网络依赖:必须联网,文本需发送至 Microsoft 服务器处理,隐私敏感场景需谨慎
  2. 服务可用性风险:依赖第三方免费服务,存在速率限制或服务变更可能,无离线备选方案
  3. 文件管理责任:临时音频文件不自动清理,需调用方(Clawdbot)负责回收
  4. 中文音色局限:相比 Azure 付费 TTS,部分中文情感风格选项较少

适合人群

  • 内容创作者:播客、短视频配音、知识付费音频制作
  • 开发者/运维:需要语音告警、日志播报、自动化通知
  • 无障碍用户:视觉障碍者、驾驶/烹饪等多任务场景听众
  • 语言学习者:跟读训练、发音对比、多语言听力材料生成

常规风险

  • 隐私泄露:合成文本上传至微软服务器,涉密内容不宜使用
  • 网络中断:无网环境完全不可用,建议关键场景配置超时重试
  • 依赖维护:node-edge-tts 为个人开发者维护,需关注版本更新与安全审计

技能正文


name: edge-tts description: | Text-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 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.

Edge-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:

  1. Call the tts tool (Clawdbot built-in) to convert text to speech
  2. The tool returns a MEDIA: path
  3. 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, -v: Voice name (default: en-US-AriaNeural)
  • --lang, -l: Language code (e.g., en-US, es-ES)
  • --format, -o: Output format (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
  • --output, -f: Output file path (default: tts_output.mp3)
  • --proxy, -p: Proxy URL (e.g., http://localhost:7890)
  • --timeout: Request timeout in milliseconds (default: 10000)
  • --list-voices, -L: List available voices

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:

  • 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 Guidelines

Rate values use percentage format:

  • "default": Normal speed
  • "-20%" to "-10%": Slow, clear (tutorials, stories, accessibility)
  • "+10%" to "+20%": Slightly fast (summaries)
  • "+30%" to "+50%": Fast (news, efficiency)

Output Formats

Choose audio quality based on use case:

  • audio-24khz-48kbitrate-mono-mp3: Standard quality (voice notes, messages)
  • audio-24khz-96kbitrate-mono-mp3: High quality (presentations, content)
  • audio-48khz-96kbitrate-stereo-mp3: Highest quality (professional audio, music)

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:

  • node-edge-tts - TTS library
  • commander - CLI argument parsing

Workflow

  1. Detect intent: Check for "tts" trigger or keyword in user message
  2. Choose method: Use built-in tts tool for simple requests, or scripts/tts-converter.js for customization
  3. Generate audio: Convert the target text (message, search results, summary)
  4. 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 npm test to check if TTS service is accessible
  • Check voice availability: Use node tts-converter.js --list-voices to see available 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 test-output.mp3 in the scripts directory

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 (/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.
  • 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 config-manager.js to set defaults
  • Default voice: en-US-MichelleNeural (female, natural)
  • Neural voices (ending in Neural) provide higher quality than Standard voices

正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。

标签

text-to-speechaccessibilityaudio-generationmicrosoft-edgeneural-voicemultilingualcli-toolvoice-synthesissubtitle-generationcontent-consumption

同类 Skill