Install
openclaw skills install volcano-engine-podcast生成火山引擎豆包语音播客(PodcastTTS)。输入主题文本,自动生成双人对话式播客音频。
openclaw skills install volcano-engine-podcast基于火山引擎 PodcastTTS API,输入主题文本,AI 自动生成双人对话播客音频(含片头音乐、多轮对话、片尾结束)。
websockets>=14.0export VOLC_APPID="your_appid"
export VOLC_ACCESS_TOKEN="your_access_token"
export VOLC_APP_KEY="your_app_key" # 可选,默认 aGjiRDfUWi
python scripts/generate_podcast.py "Hermes和OpenClaw怎么选"
import asyncio
from scripts.generate_podcast import PodcastGenerator
async def main():
gen = PodcastGenerator(
appid="3398567544",
access_token="your_token",
)
result = await gen.generate(
text="今天来聊聊AI编程助手",
output_dir="./output",
encoding="mp3",
use_head_music=True,
)
print(result["final_files"]) # 输出音频路径列表
asyncio.run(main())
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
| appid | str | 是 | - | 应用 ID |
| access_token | str | 是 | - | Access Token |
| app_key | str | 否 | aGjiRDfUWi | App Key |
| resource_id | str | 否 | volc.service_type.10050 | 资源 ID |
| endpoint | str | 否 | wss://openspeech... | WebSocket 端点 |
| 参数 | 类型 | 默认 | 说明 |
|---|---|---|---|
| text | str | 必填 | 输入主题文本 |
| output_dir | str | output | 输出目录 |
| encoding | str | mp3 | 音频格式: mp3/wav/pcm |
| use_head_music | bool | True | 是否加片头音乐 |
| use_tail_music | bool | False | 是否加片尾音乐 |
| only_nlp_text | bool | False | 只生成文本不生成音频 |
| return_audio_url | bool | False | 返回音频URL而非流式 |
| speaker_info | dict | {"random_order":False} | 说话人配置 |
| speech_rate | int | 0 | 语速 |
| skip_round_audio_save | bool | False | 跳过分段保存 |
| voice_type | str | None | 音色类型: zh_male / zh_female / multi |
| normalize_audio | bool | False | 是否对音频进行音量归一化 |
| fade_in_out | bool | False | 是否添加淡入淡出效果 |
| 值 | 说明 |
|---|---|
| None | 默认,AI 自动分配 |
| zh_male | 中文男声 |
| zh_female | 中文女声 |
| multi | 多人对话模式 |
{
"success": True,
"output_dir": "/abs/path/to/output",
"segment_files": ["output/head_music_-1.mp3", "output/zh_female_0.mp3", ...],
"final_files": ["output/podcast_final_1234567890.mp3"],
"duration": 164.51,
"texts": [
{"text": "今天这期...", "speaker": "zh_female_mizaitongxue_v2_saturn_bigtts"},
...
],
"usage": {"input_text_tokens": 0, "output_audio_tokens": 2800, "total_tokens": 2800}
}
python scripts/generate_podcast.py "主题文本" \
-o ./output \
-f mp3 \
--no-head-music \
--tail-music \
--only-text \
--voice-type zh_female \
--normalize \
--fade \
--appid YOUR_APPID \
--token YOUR_TOKEN \
-v
voice_type 为提示性参数,最终音色由服务端根据内容智能匹配