← 返回 Skills 市场
lws-lzh

Novel To Audiobook Hznuyx17

作者 lws-lzh · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
18
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install novel-to-audiobook-hznuyx17
功能描述
将小说章节转换为有声书(MP3)。当用户提到:转有声书、生成有声书、做成音频、听书、朗读章节、语音版时使用。自动分析章节内容,识别对话角色并分配不同音色,生成带背景音乐的完整有声书。
使用说明 (SKILL.md)

路径说明: 所有脚本路径相对于此 Skill 目录。 执行时: cd {skill_dir} && python scripts/...

小说转有声书

工作流程

收到用户请求后,按以下步骤执行:

第一步: 获取章节内容

从用户输入中获取章节文本:

  • 用户直接提供文本内容
  • 用户提供文件路径(如 第一章.md第一章.txt
  • 从小说项目目录中读取指定章节

同时询问用户是否需要调整:

  • 旁白音色
  • 背景音乐风格(根据章节题材自动匹配)

第二步: 分析章节 → 分段 + 角色标注

调用 DeepSeek 分析章节文本,识别旁白和对话:

python scripts/chapter_analyzer.py --file "章节文件路径" > temp_analysis.json

输出为 JSON,包含 segments 数组,每段有:

  • type: title / narration / dialogue
  • text: 分段文本
  • character: 角色名(对话时)
  • mood: 段落情绪

同时获得统计信息: 总字数、对话占比、角色列表。

注意: 将输出保存为临时 JSON 文件,供后续步骤使用。

第三步: 生成背景音乐(可选)

根据章节情绪生成纯音乐背景:

python scripts/music_generator.py \
  --mood "章节情绪(如悬疑/温馨/平静)" \
  --output "temp_bgm/bg_music.mp3"

情绪映射参考:

章节氛围 音乐风格
平静/日常 轻钢琴
悬疑/紧张 暗黑氛围
悲伤 钢琴独奏
欢快 轻快节奏
热血/战斗 管弦乐激昂

如用户不需要背景音乐,跳过此步。

第四步: 逐段生成语音

根据分段结果,调用 MiniMax TTS 为每段生成语音:

python scripts/tts_generator.py \
  --segments-file "temp_analysis.json" \
  --output-dir "temp_audio/" > temp_tts_result.json

音色分配规则:

  • 章节标题 → 主播音色(chapter_intro_voice
  • 旁白 → 统一旁白音色(narration_voice
  • 角色对话 → 根据角色名自动分配音色:
    • 女性角色 → 女声
    • 男性角色 → 男声
    • 可在 config.jsoncharacter_voices 中自定义

第五步: 合成最终有声书

拼接所有语音段 + 混入背景音乐:

python scripts/audio_assembler.py \
  --segments "temp_tts_result.json" \
  --bg-music "temp_bgm/bg_music.mp3" \
  --output "E:/qwenpaw/Novel/有声书输出/小说名_章节名.mp3"

如没有背景音乐,去掉 --bg-music 参数。

第六步: 返回结果

将最终 MP3 文件路径和信息展示给用户:

  • 文件名和路径
  • 总时长
  • 涉及角色列表

配置说明

config.json 中配置以下信息:

配置项 说明
deepseek_api_key DeepSeek API Key(分析章节文本)
minimax_api_key MiniMax API Key(TTS + 音乐生成)
tts_model TTS 模型(默认 speech-2.8-hd)
music_model 音乐模型(默认 music-2.6-free)
narration_voice 旁白音色
default_male_voice 男性角色默认音色
default_female_voice 女性角色默认音色
output_path 有声书输出目录
bg_music_volume 背景音乐音量 (0.0~1.0,默认 0.15)

使用示例

示例 1: 用户提供文件路径

用户: 帮我把第一章转成有声书,文件在 E:\qwenpaw\Novel\当前作品\第一章.md

执行流程:

python scripts/chapter_analyzer.py --file "E:/qwenpaw/Novel/当前作品/第一章.md" > temp_analysis.json

python scripts/music_generator.py --mood "平静" --output "temp_bgm/bg_music.mp3"

python scripts/tts_generator.py --segments-file temp_analysis.json --output-dir temp_audio/ > temp_tts_result.json

python scripts/audio_assembler.py --segments temp_tts_result.json --bg-music temp_bgm/bg_music.mp3 --output "E:/qwenpaw/Novel/有声书输出/当前作品_第一章.mp3"

示例 2: 用户直接粘贴章节文本

用户: 这段转有声书:(粘贴文本内容)

--text 参数直接传文本:

python scripts/chapter_analyzer.py --text "粘贴的章节内容" > temp_analysis.json

注意事项

  1. API Key: 与封面生成 Skill 共用 DeepSeek + MiniMax API Key
  2. 处理时间: 长章节(5000字以上)TTS 生成可能需要几分钟,请耐心等待
  3. 速率限制: MiniMax API 有频率限制,脚本已内置 0.3 秒延迟
  4. 音色选择: 如果角色音色不合适,可以在 config.json 的 character_voices 字段中自定义映射
  5. 背景音乐: 使用 music-2.6-free 免费模型,如需更高品质可改为 music-2.6(需付费)
  6. 临时文件: 中间音频文件会保留在 temp_audio/temp_bgm/ 目录,可手动清理
安全使用建议
Install only if you are comfortable sending the chapter text to DeepSeek and MiniMax and storing API keys in the skill configuration. Avoid using it for confidential, unpublished, or contract-restricted manuscripts unless those providers' terms and retention practices are acceptable, and review output paths before running so files are written where you expect.
能力标签
requires-sensitive-credentials
能力评估
Purpose & Capability
The file reads, API calls, temporary JSON/MP3 outputs, music generation, and final MP3 assembly all fit the stated audiobook-generation purpose.
Instruction Scope
The workflow clearly names DeepSeek and MiniMax API use, but it does not add a prominent privacy/consent warning before sending full chapter text to those providers.
Install Mechanism
The artifact contains a skill file, config file, and Python scripts; no install-time execution, obfuscation, package-install hook, or automatic persistence was found.
Credentials
The skill requires DeepSeek and MiniMax credentials and processes potentially sensitive manuscripts; that is proportionate to cloud analysis/TTS but users should use content and API keys they are comfortable exposing to those services.
Persistence & Privilege
It writes expected temporary audio/JSON files and final MP3 output paths, including user-configurable locations, but does not create background workers, privilege escalation, or long-lived system changes.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install novel-to-audiobook-hznuyx17
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /novel-to-audiobook-hznuyx17 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release of novel-to-audiobook skill. - Converts novel chapters into audiobooks (MP3) with automatic segmentation and character voice assignment. - Supports text input or file path for chapter content. - Analyzes narrative/dialogue, assigns voices, and generates background music to match chapter mood. - Integrates DeepSeek for content analysis and MiniMax for TTS and music generation (API key required). - Outputs final audiobook with mixed background music, plus details such as file path, duration, and character list. - Users can customize narrator/character voices, music style, and output location in config.json.
元数据
Slug novel-to-audiobook-hznuyx17
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Novel To Audiobook Hznuyx17 是什么?

将小说章节转换为有声书(MP3)。当用户提到:转有声书、生成有声书、做成音频、听书、朗读章节、语音版时使用。自动分析章节内容,识别对话角色并分配不同音色,生成带背景音乐的完整有声书。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 18 次。

如何安装 Novel To Audiobook Hznuyx17?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install novel-to-audiobook-hznuyx17」即可一键安装,无需额外配置。

Novel To Audiobook Hznuyx17 是免费的吗?

是的,Novel To Audiobook Hznuyx17 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Novel To Audiobook Hznuyx17 支持哪些平台?

Novel To Audiobook Hznuyx17 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Novel To Audiobook Hznuyx17?

由 lws-lzh(@lws-lzh)开发并维护,当前版本 v1.0.0。

💬 留言讨论