byted-podcast-tts
Podcast TTS Skill
基于火山引擎豆包语音合成 WebSocket 协议(PodcastTTS,/api/v3/sami/podcasttts)将某个话题合成为播客音频并保存为本地文件。支持:
- 输入一句话题文本或者一个网页地址(也可以是个文件下载地址,支持 pdf/word/txt 格式)生成播客
- 输出播客音频下载链接
- 输出播客分段文本(JSON)
适用场景
- 用户提到
生成播客或播客合成等相关关键词。 - 用户需要为某个话题生成播客形式的音频文件。
- 用户需要某个网页或文件内容生成播客形式的音频文件。
- 用户需要为用户上传的文件内容或者一个长上下文生成播客形式的音频文件。
使用步骤
- 分析用户需要合成播客的内容,准备要合成的输入:
prompt_text(原始话题,一般不超过 20 个字)或input_url(网页地址或文件下载地址) 或者text(用户上传文件读取出来的内容或者是一个比较长的文本,一般超过 200 个字)。 - 运行脚本前先
cd到本技能目录:skills/byted-podcast-gen。 - 配置鉴权(环境变量或命令行参数)。
- 执行脚本:
python scripts/podcast.py [参数]。参考下面示例部分。 - 根据脚本输出的 JSON 里的
audio_path/texts/audio_url使用生成结果,如果有audio_url是一个带过期时间的 URL, 可以返回给用户,audio_path是本地文件路径, 可以给用户提供下载。
环境变量与鉴权
该脚本通过 WebSocket Header 进行鉴权。你可以用命令行参数传入,也可以配置环境变量(推荐,避免在命令行历史里泄露凭证):
- 必填:
MODEL_SPEECH_API_KEY
脚本参数
| 参数 | 简写 | 必填 | 说明 |
|---|---|---|---|
--text |
否 | 输入原始长文本(action=0 时使用) |
|
--input_url |
否 | 输入文本的 URL(action=0 时使用,二选一) |
|
--prompt_text |
否 | 提示词文本(action=4 时必填) |
|
--action |
否 | 播客类型:0(原始文本/URL)、4(prompt);默认 4 |
|
--speaker_info |
否 | 说话人配置 JSON(默认 {"random_order":false}) |
|
--encoding |
否 | 音频格式:mp3(默认)、wav、ogg_opus |
|
--output |
否 | 最终音频输出文件路径(默认自动生成到 output/) |
返回值说明
脚本输出 JSON,包含:
status:"success"或"error"task_id: 任务标识(用于定位一次生成任务)audio_path: 最终音频本地路径texts: 分段文本 JSON 字符串,每个发音人对应的文本列表。audio_url: 服务端返回的音频下载地址error: 失败时的错误信息
错误处理
- 若报错提示缺少
MODEL_SPEECH_API_KEY:检查环境变量或命令行参数是否已配置,不存在的时候提示用户输入, 然后设置到环境变量。 - 若收到服务端错误(
MsgType.Error):根据错误信息检查账号权限、资源 ID、输入内容及是否已开通服务。 - 若收到服务端错误包含关键字
quota说明当前账号已超量,需升级火山引擎豆包语音的播客服务。 - python 执行缺少相关 package 时,需要先安装依赖:
pip install -r requirements.txt
参考文档
示例
# 基于话题生成播客音频
ptompt_text="豆包语音合成服务"
python scripts/podcast.py --prompt_text $ptompt_text --action 4
# 基于网页内容生成播客音频
url="https://www.volcengine.com/docs/6561/1668014?lang=zh"
python scripts/podcast.py --input_url $url --action 0
# 基于长文本内容生成播客音频
text="欢迎收听本期节目,我们聊聊人工智能的关键拐点……"
python scripts/podcast.py --text $text --action 0
More from bytedance/agentkit-samples
byted-web-search
火山引擎联网搜索 API,返回网页/图片结果。联网搜索场景优先使用本 skill。触发词包括:查/搜/找、真的吗/靠谱吗/确认/核实、最近/今天/最新/近期、出处/来源/链接、有什么/有哪些/推荐、价格/政策/汇率/行情、对比/区别/哪个好、听说/据说/不太确定、热搜/热门/火、帮我看/了解一下、求证/辟谣、值不值得/该不该。任务依赖在线事实或时效性时优先使用。若回答可能依赖外部事实,优先调用本 skill 再作答。支持 API Key / AK/SK。
369byted-las-video-edit
Extracts and clips video segments from long videos using natural language descriptions. AI-powered smart video editing, video trimming, and video cutting powered by Volcengine LAS. Describe what you want — scenes, people, objects, actions, events — and get trimmed clips automatically. Video search and video content retrieval: find and locate specific people, objects, or scenes in footage. Supports reference images for person matching and object matching (search video by image). Two modes: simple (fast) and detail (thorough, optional ASR). Use this skill when the user wants to edit/clip/cut videos using natural language descriptions, extract highlights or key moments from videos, find specific people/objects/scenes in video footage (by text or reference image), compile highlight reels from long videos, trim video segments, or do AI-powered smart video editing.
163byted-data-search
|
106byted-las-vlm-video
Analyzes and understands video content using Volcengine LAS Doubao vision-language models (VLM). Multimodal AI video analysis, video comprehension, and visual understanding of video clips and footage. Performs video question answering (video Q&A) — ask questions about what happens in a video and get AI answers. Scene recognition and scene description, object recognition and object detection, action recognition and action detection from video frames. Generates video descriptions, video captions, video summaries, video annotations, and content summarization. Visual frame analysis for identifying people, objects, actions, and events in video. Auto-compresses video to 50MB before inference. Synchronous single-call processing. Use this skill when the user wants to analyze or understand video content using VLM/AI, do video Q&A (ask questions about a video), describe what happens in a video, recognize objects/actions/scenes in video frames, generate video captions/descriptions/summaries, annotate or label video content, get AI-powered visual understanding of video clips, or perform multimodal video analysis with vision-language models.
97byted-text-to-speech
将文本合成为语音(TTS)。使用火山引擎豆包语音合成 API,支持流式合成、多种音色、语速/音调/音量调节、Markdown 过滤和 LaTeX 公式播报。当用户需要把文字转成语音、生成朗读音频、配音、旁白、播报,或提到「文字转语音」「TTS」「语音合成」「朗读」「配音」时使用本技能。
93byted-marketing-agent-inspiration-insight
当用户想找创意灵感、看爆款视频的分镜脚本或复刻提示词、拆解热门内容的视觉元素和关键帧、了解某行业出圈视频的创作思路时使用。手动触发:/inspiration
71