Chinese Bedtime Story Generator
/install bedtime-story
中文睡前故事生成器
适用范围
此 Skill 用于生成可播放的多角色中文睡前故事音频。
能力边界:
- 依赖
LLM生成故事文本,TTS合成多角色语音 - 支持自定义孩子姓名、年龄、兴趣爱好
- 支持连载模式,跨会话保持世界观和情节连贯
- 输出完整 MP3 音频 + 故事文本 + 状态文件
不做:
- 实时语音对话或 ASR 识别
- 视频或动画生成
- 英文故事
默认配置
child_name:小朋友age:5interests:冒险,动物episodes:1(单集)
音色分配
| 角色 | voice_id | speed | pitch |
|---|---|---|---|
| 旁白 narrator | male_0004_a | 0.9 | 0 |
| 主角 protagonist | child_0001_a | 1.0 | 0 |
| 小伙伴 sidekick | child_0001_b | 1.0 | 0 |
| 长者 elder | male_0018_a | 0.85 | -2 |
工作流
-
初始化
- 读取
--child-name、--age、--interests参数 - 若
--continue,从story_state.json加载已有世界观和角色
- 读取
-
世界观与角色创建(首次运行)
- LLM 生成世界名称、背景设定、4个角色(旁白/主角/小伙伴/长者)
- 主角名称默认使用孩子姓名
-
故事生成
- LLM 生成 12-20 段 segments,每段标注 speaker 和 text
- 连载模式下传入上集摘要,保持情节连贯
-
TTS 多角色合成
- 逐段根据 speaker 选择对应音色参数
- 合成每段音频
-
音频拼接
- MP3 帧独立可解码,直接二进制追加拼接
- 无需 ffmpeg
-
保存输出
story_state.json:世界观+角色+情节摘要story_ep{N}.txt:故事文本story_ep{N}.mp3:完整音频
Prompt 模块
数据结构
详见 references/state_schema_cn.md。
直接运行
pip install -r requirements.txt
# 首次生成
python scripts/run_story.py --child-name "小明" --age 5 --interests "恐龙,太空"
# 连载续写
python scripts/run_story.py --continue
# 不调用 TTS,仅输出文本
python scripts/run_story.py --child-name "小红" --age 7 --interests "魔法,精灵" --no-tts
# 生成多集
python scripts/run_story.py --child-name "小明" --age 5 --interests "恐龙,太空" --episodes 3
环境变量参考:.env.example
接口约定:
- LLM 读取
STORY_LLM_API_KEY,回退到IME_MODEL_API_KEY - TTS 读取
STORY_TTS_API_KEY,回退到SENSEAUDIO_API_KEY
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install bedtime-story - After installation, invoke the skill by name or use
/bedtime-story - Provide required inputs per the skill's parameter spec and get structured output
What is Chinese Bedtime Story Generator?
生成多角色中文睡前故事并合成语音。适用于用户想为孩子定制个性化睡前故事的场景:根据孩子姓名、年龄和兴趣,由 LLM 创建完整世界观和角色,生成分段故事文本(每段标注说话人),再由 TTS 以不同音色合成旁白、主角、小伙伴和长者的语音,最终拼接为完整 MP3 音频文件。支持连载模式(`--continue`)在多次... It is an AI Agent Skill for Claude Code / OpenClaw, with 290 downloads so far.
How do I install Chinese Bedtime Story Generator?
Run "/install bedtime-story" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is Chinese Bedtime Story Generator free?
Yes, Chinese Bedtime Story Generator is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does Chinese Bedtime Story Generator support?
Chinese Bedtime Story Generator is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created Chinese Bedtime Story Generator?
It is built and maintained by Delong-liu-bupt (@delong-liu-bupt); the current version is v1.0.1.