Pywayne TTS:专业的文本转语音音频生成 - Openclaw Skills
作者:互联网
2026-04-05
什么是 Pywayne TTS?
Pywayne TTS 是一款专为增强 AI 智能体能力而设计的音频生成实用工具。通过将此工具集成到您的 Openclaw Skills 工作流中,您可以使用两种不同的引擎从文本合成语音:用于快速本地处理的 macOS 原生 say 命令,以及提供广泛语言支持和云端灵活性的 Google TTS (gTTS) 服务。
该技能专注于效率和输出质量,利用 ffmpeg 的强大功能确保生成的音频文件针对其预期用途进行了优化。无论您是需要语音应用中紧凑、高保真的 Opus 格式,还是需要多媒体播放中通用兼容的 MP3 格式,此工具都能在文本数据和音频内容之间提供可靠的桥梁。
下载入口:https://github.com/openclaw/skills/tree/main/skills/wangyendt/tts-2
安装与下载
1. ClawHub CLI
从源直接安装技能的最快方式。
npx clawhub@latest install tts-2
2. 手动安装
将技能文件夹复制到以下位置之一
全局模式~/.openclaw/skills/
工作区
/skills/
优先级:工作区 > 本地 > 内置
3. 提示词安装
将此提示词复制到 OpenClaw 即可自动安装。
请帮我使用 Clawhub 安装 tts-2。如果尚未安装 Clawhub,请先安装(npm i -g clawhub)。
Pywayne TTS 应用场景
- 为开发人员工具和 AI 智能体创建自动化语音通知。
- 为培训材料或演示文稿生成本地化的音频剪辑。
- 将长文本转换为便携式 MP3 文件以便离线收听。
- 将高质量语音输出集成到自定义 Openclaw Skills 或自动化脚本中。
- 用户提供文本字符串并指定具有 .opus 或 .mp3 扩展名的目标文件名。
- 该技能识别宿主平台并检查是否存在 ffmpeg 依赖项。
- 根据配置,在 macOS 原生合成引擎或 Google TTS API 之间进行选择。
- 捕获原始音频流并通过 ffmpeg 进行处理,以满足特定的编解码器要求(例如,Opus 的 16kHz 单声道)。
- 最终音频文件写入磁盘,所有中间临时文件都会从系统中自动清除。
Pywayne TTS 配置指南
要在 Openclaw Skills 环境中使用 Pywayne TTS,请确保您的系统中已安装 ffmpeg。
# macOS 用户
brew install ffmpeg
# Ubuntu/Debian 用户
sudo apt update && sudo apt install ffmpeg
# 安装所需的 Python 库
pip install gtts
Pywayne TTS 数据架构与分类体系
该技能通过结构化参数和自动化文件处理来管理音频制作。以下是音频输出规范的架构:
| 特性 | Opus 格式 | MP3 格式 |
|---|---|---|
| 采样率 | 16kHz | 可变(标准) |
| 声道 | 单声道 | 立体声/单声道 |
| 使用场景 | 语音通话 / 小体积 | 通用播放 |
| 引擎 | macOS say / gTTS | macOS say / gTTS |
所有文件均根据函数调用中提供的 opus_filename 或 mp3_filename 生成。
name: pywayne-tts
description: Text-to-speech conversion tool. Use when converting text to speech audio files (opus or mp3 format). Supports macOS native 'say' command and Google TTS (gTTS) service with ffmpeg audio conversion.
Pywayne TTS
Text-to-speech (TTS) tool that converts text to audio files (opus or mp3 format).
Functions
text_to_speech_output_opus - Convert text to Opus format
from pywayne.tts import text_to_speech_output_opus
# Output: test.opus
text_to_speech_output_opus("你好,世界", "test.opus")
Parameters:
text- Text to convertopus_filename- Output .opus filenameuse_say- If True, use macOS 'say' command; otherwise use gTTS (default True)
Behavior:
- On macOS, prefers native 'say' command when
use_say=True - On other platforms, uses Google TTS (gTTS) service
- Uses ffmpeg to convert audio to opus format (16kHz, mono channel)
- Automatically cleans up temporary files
text_to_speech_output_mp3 - Convert text to MP3 format
from pywayne.tts import text_to_speech_output_mp3
# Output: test.mp3
text_to_speech_output_mp3("你好,世界", "test.mp3")
Parameters:
text- Text to convertmp3_filename- Output .mp3 filenameuse_say- If True, use macOS 'say' command; otherwise use gTTS (default True)
Behavior:
- On macOS, prefers native 'say' command when
use_say=True - On other platforms, uses Google TTS (gTTS) service
- Uses ffmpeg to convert audio to mp3 format
- Automatically cleans up temporary files
Quick Start
# Convert text to Opus format (default: macOS uses 'say')
text_to_speech_output_opus "你好,世界" "test.opus"
# Convert text to MP3 format
text_to_speech_output_mp3 "你好,世界" "test.mp3"
# Force use gTTS instead of macOS 'say'
text_to_speech_output_mp3 "你好,世界" "test.mp3" use_say=False
Requirements
- ffmpeg: Required for audio conversion
- macOS:
brew install ffmpeg - Windows: Download from https://ffmpeg.org and add to PATH
- Linux:
sudo apt install ffmpegor package manager
- macOS:
- gtts: Python library for Google TTS service
Platform Detection
Module automatically detects platform and prompts for ffmpeg installation if missing.
Audio Formats
- Opus: Better quality, smaller file size, suitable for voice calls
- MP3: Better compatibility, suitable for multimedia playback
Notes
- Requires network connection for gTTS service
- Temporary files are automatically cleaned up
- Ensure output directory has write permissions
相关推荐
专题
+ 收藏
+ 收藏
+ 收藏
+ 收藏
+ 收藏
+ 收藏
最新数据
相关文章
Antigravity 图像:Gemini 3 Pro 图像集成 - Openclaw Skills
Inkdrop Notes:利用 Openclaw Skills 进行程序化知识管理
简历生成器:通过 YAML 生成专业简历 - Openclaw Skills
Callmac:远程Mac语音控制与TTS - Openclaw Skills
策略引擎:治理与安全层 - Openclaw Skills
Stable Diffusion 提示词指南:掌握图像生成 - Openclaw Skills
博客撰写助手:润色草稿并修复语法 - Openclaw Skills
内幕钱包查找器:聪明钱与链上 Alpha - Openclaw 技能
内幕钱包查找器:聪明钱与鲸鱼追踪 - Openclaw Skills
内部钱包查找器:聪明钱与巨鲸追踪器 - Openclaw Skills
AI精选
