Skip to content

Repository files navigation

EPUB → MP3(CosyVoice 有声书)

将 EPUB 按章节转为 CosyVoice3 中文有声书 MP3,支持断点续传与批量转换。

环境

  • Windows + NVIDIA GPU(建议 8GB+ 显存)
  • Conda 环境 cosyvoice(Python 3.10)
  • FFmpeg 已加入 PATH
  • CosyVoice 源码与模型需自行下载到 cosyvoice/(见下方)

快速开始

  1. 将 EPUB 放到项目根目录
  2. 将参考音频放到 assets/reference.wav(≤30 秒)
  3. 运行:
python convert.py --list-chapters
python convert.py --chapter 5          # 试转单章
python convert.py --all              # 全书(断点续传)

或使用 run_convert.bat

常用参数

参数 说明
--chapter N 转换第 N 章
--all 转换全书
--force-tts 强制重新合成
--tts-chunk-chars 320 每批合并字数(越大越快)
--tts-speed 1.0 语速倍率(最高 1.2)

CosyVoice 安装

git clone https://github.com/FunAudioLLM/CosyVoice.git cosyvoice
# 下载 Fun-CosyVoice3-0.5B-2512 到 cosyvoice/pretrained_models/

详见 scripts/download_model.bat

无人值守

python watch_convert.py   # 失败自动重试
python status.py          # 查看进度

输出

  • MP3:output/mp3/
  • 缓存:output/cache/
  • 进度:state/progress.json

About

EPUB to CosyVoice audiobook MP3 converter

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages