AI turns documents or topics into real, native PowerPoint decks—with native shapes, transitions and animations, data-backed charts and tables on demand, audio narration from speaker notes, and support for your own .pptx templates. · by Hugo He
feat(audio): add MiniMax Qwen and CosyVoice backends
hugohe3b28e148d063d
diff --git a/.env.example b/.env.exampleindex 3811e8ee..ac2873dc 100644--- a/.env.example+++ b/.env.example@@ -131,11 +131,21 @@# Audio narration TTS (notes_to_audio.py) / 旁白音频 TTS# ─────────────────────────────────────────────────────────────# edge-tts is the default narration backend and needs no API key.-# Use ElevenLabs only when you want high-quality cloud narration.+# Use cloud providers only when you want high-quality or cloned voices.# edge-tts 是默认旁白后端,无需 API Key。-# 需要高质量云端旁白时再配置 ElevenLabs。+# 需要高质量云端旁白或复刻音色时再配置云端提供商。## ELEVENLABS_API_KEY=your-elevenlabs-api-key+# MINIMAX_API_KEY=your-minimax-key+# QWEN_API_KEY=your-dashscope-key+# COSYVOICE_API_KEY=your-dashscope-key+# DASHSCOPE_API_KEY=your-dashscope-key+#+# Optional provider-specific TTS endpoint overrides.+# 可选:按提供商覆盖 TTS 接入点。+# MINIMAX_TTS_BASE_URL=https://api.minimax.io/v1/t2a_v2+# QWEN_TTS_BASE_URL=https://dashscope-intl.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generation+# COSYVOICE_TTS_BASE_URL=https://dashscope.aliyuncs.com/api/v1/services/audio/tts/SpeechSynthesizer# ─────────────────────────────────────────────────────────────# Web image search (image_search.py) / 网络图片搜索diff --git a/README.md b/README.mdindex 25920e25..4734b02d 100644--- a/README.md+++ b/README.md@@ -40,7 +40,7 @@ Drop in a PDF, DOCX, URL, or Markdown — get back a **natively editable PowerPo> **Animations** — exported decks support **page transitions** and **per-element entrance animations** as real OOXML, not embedded video. By default, elements cascade in automatically on slide entry — no clicking needed. Plays natively in PowerPoint and Keynote, no extra tooling. See [Animations & Transitions →](./skills/ppt-master/references/animations.md).-> **Narration & Video** — generate per-slide voice narration from the speaker notes (90+ locales via `edge-tts`), embed the audio back into the PPTX, and let PowerPoint export the deck as an MP4 video — synced narration + transitions, no third-party tools. See [Audio Narration & Video Export →](./docs/audio-narration.md).+> **Narration & Video** — generate per-slide voice narration from the speaker notes (`edge-tts` by default, optional cloud TTS providers for high-quality or cloned voices), embed the audio back into the PPTX, and let PowerPoint export the deck as an MP4 video — synced narration + transitions, no third-party tools. See [Audio Narration & Video Export →](./docs/audio-narration.md).> **How it works** — PPT Master is a workflow (a "skill") that works inside AI IDEs like Claude Code, Cursor, VS Code + Copilot, or Codebuddy. You chat with the AI — "make a deck from this PDF" — and it follows the workflow to produce a real editable `.pptx` on your computer. No coding on your side; the IDE is just where the conversation happens.>diff --git a/README_CN.md b/README_CN.mdindex 57eb5979..62ac6474 100644--- a/README_CN.md+++ b/README_CN.md@@ -40,7 +40,7 @@> **动画** —— 导出的 deck 支持**页间转场**和**页内元素入场动画**,输出为真正的 OOXML 动画(不是嵌入视频)。默认进入页面后元素按顺序自动级联入场,无需点击;在 PowerPoint 和 Keynote 中原生播放,无需额外工具。详见 [转场与动画使用指南 →](./docs/zh/animations.md)。-> **旁白与视频** —— 把演讲者备注按页生成语音旁白(基于 `edge-tts`,支持 90+ 语种 locale),把音频嵌回 PPTX,再用 PowerPoint 自带"导出视频"产出带旁白和转场的 MP4,全程无需第三方工具。详见 [音频旁白与视频导出 →](./docs/zh/audio-narration.md)。+> **旁白与视频** —— 把演讲者备注按页生成语音旁白(默认 `edge-tts`,也可配置云端 TTS 使用高质量或复刻音色),把音频嵌回 PPTX,再用 PowerPoint 自带"导出视频"产出带旁白和转场的 MP4,全程无需第三方工具。详见 [音频旁白与视频导出 →](./docs/zh/audio-narration.md)。> **运作方式** —— PPT Master 是一套在 AI IDE(Claude Code / Cursor / VS Code + Copilot / Codebuddy 等)里运行的工作流(一个 "skill")。你在 IDE 的对话框里跟 AI 说"用这份 PDF 做一份 PPT",AI 按这套工作流在你本机生成一个真正可编辑的 `.pptx`。你不写任何代码——IDE 只是你和 AI 对话的地方。>diff --git a/docs/audio-narration.md b/docs/audio-narration.mdindex cf68d6fb..b2ec6400 100644--- a/docs/audio-narration.md+++ b/docs/audio-narration.md@@ -1,10 +1,10 @@# Audio Narration & Video Export-PPT Master can turn the speaker notes into per-slide MP3 narration via [`edge-tts`](https://github.com/rany2/edge-tts) (Microsoft Edge's online neural voices) by default, or via ElevenLabs when you need higher-quality cloud narration. It can then embed the audio back into the PPTX and let PowerPoint export the deck as an MP4 video — with synced narration and slide transitions, no extra tools.+PPT Master can turn the speaker notes into per-slide narration via [`edge-tts`](https://github.com/rany2/edge-tts) (Microsoft Edge's online neural voices) by default, or via ElevenLabs, MiniMax, Qwen TTS, and CosyVoice when you need higher-quality cloud narration or a cloned voice. It can then embed the audio back into the PPTX and let PowerPoint export the deck as an MP4 video — with synced narration and slide transitions, no extra tools.## What you get-- One MP3 per slide under `<project_path>/audio/`, named to match the SVG (`01_cover.mp3`, `02_market_landscape.mp3`, …).+- One audio file per slide under `<project_path>/audio/`, named to match the SVG (`01_cover.mp3`, `02_market_landscape.mp3`, …).- Optional re-export: a new PPTX in `exports/` with each MP3 embedded into the matching slide and slide auto-advance timings set to the audio length, so kiosk/auto-play and video export work without manual timing.- The original speaker notes are preserved.@@ -56,6 +56,28 @@ python3 skills/ppt-master/scripts/notes_to_audio.py <project_path> \--voice-id <elevenlabs-voice-id> \--elevenlabs-model eleven_multilingual_v2+# 2C. Or generate MP3s with MiniMax (supports system and cloned voice_id)+export MINIMAX_API_KEY="your-minimax-api-key"+python3 skills/ppt-master/scripts/notes_to_audio.py <project_path> \+ --provider minimax \+ --voice-id <minimax-voice-id> \+ --minimax-model speech-2.8-hd++# 2D. Or generate audio with Qwen TTS (system voice or cloned voice)+export DASHSCOPE_API_KEY="your-dashscope-api-key"+python3 skills/ppt-master/scripts/notes_to_audio.py <project_path> \+ --provider qwen \+ --voice-id <qwen-voice> \+ --qwen-model qwen3-tts-flash \+ --qwen-language-type Chinese++# 2E. Or generate MP3s with CosyVoice (system voice or cloned/designed voice_id)+export COSYVOICE_API_KEY="your-dashscope-api-key"+python3 skills/ppt-master/scripts/notes_to_audio.py <project_path> \+ --provider cosyvoice \+ --voice-id <cosyvoice-voice> \+ --cosyvoice-model cosyvoice-v3-flash+# 3. (Optional) Re-export PPTX with audio embeddedpython3 skills/ppt-master/scripts/svg_to_pptx.py <project_path> -s final \--recorded-narration audio@@ -70,6 +92,8 @@ export ELEVENLABS_API_KEY="your-elevenlabs-api-key"python3 skills/ppt-master/scripts/notes_to_audio.py --provider elevenlabs --list-voices```+For MiniMax, Qwen, and CosyVoice, pass the provider-specific system voice or cloned voice ID/name with `--voice-id`. Voice cloning itself is performed in the provider's console/API first; `notes_to_audio.py` uses the resulting voice ID to generate per-slide narration.+## Dependency```bash@@ -78,7 +102,7 @@ python3 -m pip install edge-ttsAlready listed in `skills/ppt-master/requirements.txt`. `edge-tts` calls Microsoft's online TTS service — an internet connection is required at generation time. The MP3s themselves are local files; nothing about playback or PowerPoint export depends on the network afterwards.-ElevenLabs does not require an extra Python package; it uses HTTPS directly. Configure `ELEVENLABS_API_KEY` in the current shell or in `.env` based on `.env.example`.+Cloud TTS providers do not require extra Python packages; they use HTTPS directly. Configure the relevant API key in the current shell or in `.env` based on `.env.example`.## Tipsdiff --git a/docs/zh/audio-narration.md b/docs/zh/audio-narration.mdindex e52940c7..a56f467b 100644--- a/docs/zh/audio-narration.md+++ b/docs/zh/audio-narration.md@@ -1,19 +1,19 @@# 音频旁白与视频导出-PPT Master 可以把演讲者备注转成逐页 MP3 旁白(基于 [`edge-tts`](https://github.com/rany2/edge-tts) —— 微软 Edge 的在线神经网络语音),再把音频嵌入回 PPTX,由 PowerPoint 自带的"导出视频"一键产出带旁白和转场的 MP4,全程无需第三方工具。+PPT Master 可以把演讲者备注转成逐页音频旁白(默认基于 [`edge-tts`](https://github.com/rany2/edge-tts) —— 微软 Edge 的在线神经网络语音;也可配置 ElevenLabs、MiniMax、Qwen TTS、CosyVoice 使用高质量或复刻音色),再把音频嵌入回 PPTX,由 PowerPoint 自带的"导出视频"一键产出带旁白和转场的 MP4,全程无需第三方工具。## 你会得到什么-- 每页一个 MP3 文件,存放于 `<project_path>/audio/`,文件名与 SVG 对齐(`01_cover.mp3`、`02_market_landscape.mp3` …)。-- 可选重新导出:在 `exports/` 生成新版 PPTX,每页对应的 MP3 已嵌入到该页,且页面切换时间按音频长度自动设置——无人值守自动播放和视频导出都不用再手动调时间。+- 每页一个音频文件,存放于 `<project_path>/audio/`,文件名与 SVG 对齐(`01_cover.mp3`、`02_market_landscape.mp3` …)。+- 可选重新导出:在 `exports/` 生成新版 PPTX,每页对应的音频已嵌入到该页,且页面切换时间按音频长度自动设置——无人值守自动播放和视频导出都不用再手动调时间。- 演讲者备注原样保留。## 它是怎么做到的1. **备注本身就是为 TTS 写的口播稿**。PPT Master 的 notes 规范刻意产出适合朗读的散文——没有 `[过渡]` / `[停顿]` 这种舞台标记,也没有 `要点:` / `时长:` 这种 meta 行——念出来的内容就是页面上的内容。-2. **AI 替你选音色**。当你提出生成旁白时,AI 根据 deck 的主语言(`zh-CN` / `en-US` / `ja-JP` / `ko-KR` / …)拉取该 locale 下的 `edge-tts` 音色清单,挑出 3–6 个候选并给每个写一句中文调性说明(如"稳重男声·适合财报")。语速也会基于 notes 信息密度给出推荐值。-3. **一次问完,一次回答**。AI 在一条消息里同时问三件事——音色、语速、是否把音频嵌入回 PPTX——每项都标了推荐值。回"好"接受全部默认,或者只说要改的部分(如"音色 2,语速 -5%")。-4. **执行**。脚本写出 MP3 到 `audio/`,再(如果你保留嵌入)重新导出带音频的 PPTX。+2. **AI 替你选音色**。当你提出生成旁白时,AI 根据 deck 的主语言(`zh-CN` / `en-US` / `ja-JP` / `ko-KR` / …)和所选 provider 拉取或解释可用音色,挑出候选并给每个写一句中文调性说明(如"稳重男声·适合财报")。语速/风格也会基于 notes 信息密度给出推荐值。+3. **一次问完,一次回答**。AI 在一条消息里同时问三件事——生成模式、音色、是否把音频嵌入回 PPTX——每项都标了推荐值。回"好"接受全部默认,或者只说要改的部分(如"音色 2,语速 -5%")。+4. **执行**。脚本写出音频到 `audio/`,再(如果你保留嵌入)重新导出带音频的 PPTX。完整流程见 [`workflows/generate-audio.md`](../../skills/ppt-master/workflows/generate-audio.md)。@@ -45,16 +45,38 @@ python3 skills/ppt-master/scripts/notes_to_audio.py --list-voices --locale ja-JP# 1. 确保备注已切分(后处理 Step 7.1)python3 skills/ppt-master/scripts/total_md_split.py <project_path>-# 2. 生成 MP3+# 2A. 用 edge-tts 生成 MP3(默认,无需 API Key)python3 skills/ppt-master/scripts/notes_to_audio.py <project_path> \--voice zh-CN-YunjianNeural --rate +0%+# 2B. 用 MiniMax 生成 MP3(支持系统音色或复刻 voice_id)+export MINIMAX_API_KEY="your-minimax-api-key"+python3 skills/ppt-master/scripts/notes_to_audio.py <project_path> \+ --provider minimax \+ --voice-id <minimax-voice-id> \+ --minimax-model speech-2.8-hd++# 2C. 用 Qwen TTS 生成音频(系统音色或复刻音色)+export DASHSCOPE_API_KEY="your-dashscope-api-key"+python3 skills/ppt-master/scripts/notes_to_audio.py <project_path> \+ --provider qwen \+ --voice-id <qwen-voice> \+ --qwen-model qwen3-tts-flash \+ --qwen-language-type Chinese++# 2D. 用 CosyVoice 生成 MP3(系统音色或复刻/设计音色)+export COSYVOICE_API_KEY="your-dashscope-api-key"+python3 skills/ppt-master/scripts/notes_to_audio.py <project_path> \+ --provider cosyvoice \+ --voice-id <cosyvoice-voice> \+ --cosyvoice-model cosyvoice-v3-flash+# 3.(可选)重新导出 PPTX 嵌入音频python3 skills/ppt-master/scripts/svg_to_pptx.py <project_path> -s final \--recorded-narration audio```-`--voice` 是必填项——脚本会拒绝未指定音色的调用。用 `--list-voices --locale <locale>` 查可用音色。+edge 模式下 `--voice` 是必填项。云端 provider 使用 `--voice-id` 传入对应平台的系统音色或复刻音色 ID。声音复刻本身先在对应平台控制台/API 中完成,`notes_to_audio.py` 使用得到的 voice ID 生成逐页旁白。## 依赖@@ -62,7 +84,7 @@ python3 skills/ppt-master/scripts/svg_to_pptx.py <project_path> -s final \python3 -m pip install edge-tts```-已写入 `skills/ppt-master/requirements.txt`。`edge-tts` 调用微软的在线 TTS 服务,**生成时**需要联网;生成后的 MP3 是本地文件,PowerPoint 播放和视频导出都不依赖网络。+已写入 `skills/ppt-master/requirements.txt`。`edge-tts` 调用微软的在线 TTS 服务,**生成时**需要联网;生成后的音频是本地文件,PowerPoint 播放和视频导出都不依赖网络。云端 TTS provider 不需要额外 Python 包,直接通过 HTTPS 调用;按 `.env.example` 配置对应 API Key 即可。## 经验值diff --git a/skills/ppt-master/SKILL.md b/skills/ppt-master/SKILL.mdindex 86ed9c51..9e2b396a 100644--- a/skills/ppt-master/SKILL.md+++ b/skills/ppt-master/SKILL.md@@ -327,9 +327,9 @@ python3 ${SKILL_DIR}/scripts/svg_to_pptx.py <project_path> -s final**Optional recorded narration** (only when the user asks for narrated/video export):-Run the standalone [`generate-audio`](workflows/generate-audio.md) workflow. The AI picks voice candidates from the locale-filtered `edge-tts` catalog, asks the user once (voice + rate + embed-or-not, all with recommended values), then executes `notes_to_audio.py` and (if chosen) re-exports the PPTX with `--recorded-narration audio`.+Run the standalone [`generate-audio`](workflows/generate-audio.md) workflow. The AI picks a narration backend (`edge` by default, or a configured cloud provider such as ElevenLabs / MiniMax / Qwen / CosyVoice for high-quality or cloned voices), asks the user once (backend + voice + rate/settings + embed-or-not, all with recommended values), then executes `notes_to_audio.py` and (if chosen) re-exports the PPTX with `--recorded-narration audio`.-Do NOT call `notes_to_audio.py` directly without going through the workflow — `--voice` is required and the workflow produces the locale-aware recommendation that makes the choice meaningful.+Do NOT call `notes_to_audio.py` directly without going through the workflow — `--voice` / `--voice-id` is required and the workflow produces the locale/provider-aware recommendation that makes the choice meaningful.Full effect list, anchor logic, and limits: [`references/animations.md`](references/animations.md).diff --git a/skills/ppt-master/references/shared-standards.md b/skills/ppt-master/references/shared-standards.mdindex 8c9168d2..b2ec2571 100644--- a/skills/ppt-master/references/shared-standards.md+++ b/skills/ppt-master/references/shared-standards.md@@ -321,7 +321,7 @@ python3 scripts/notes_to_audio.py <project_path> --voice zh-CN-XiaoxiaoNeuralpython3 scripts/svg_to_pptx.py <project_path> -s final --recorded-narration audio```-- `notes_to_audio.py` reads split `notes/*.md` files and writes one MP3 per slide to `audio/`.+- `notes_to_audio.py` reads split `notes/*.md` files and writes one audio file per slide to `audio/`. Default `edge` output is MP3; configured cloud providers may output MP3 or WAV depending on provider settings.- `--recorded-narration audio` embeds matching audio, keeps speaker notes, and sets slide timings from audio duration.Full reference: [`animations.md`](animations.md).diff --git a/skills/ppt-master/scripts/docs/svg-pipeline.md b/skills/ppt-master/scripts/docs/svg-pipeline.mdindex a50c3a34..4c221831 100644--- a/skills/ppt-master/scripts/docs/svg-pipeline.md+++ b/skills/ppt-master/scripts/docs/svg-pipeline.md@@ -49,11 +49,11 @@ Behavior:- Recommended source directory: `svg_final/`- Speaker notes are embedded automatically unless `--no-notes` is used- Recorded narration is opt-in:- - `notes_to_audio.py` uses the cross-platform Python package `edge-tts` and generates one MP3 file per slide into `audio/`+ - `notes_to_audio.py` uses `edge-tts` by default, or a configured cloud TTS provider (`elevenlabs`, `minimax`, `qwen`, `cosyvoice`), and generates one audio file per slide into `audio/`- Narration text is read strictly from the matching `notes/*.md` file; the script only skips Markdown heading lines (`# ...`) and does not summarize, rewrite, or filter delivery notes- `--recorded-narration audio` keeps speaker notes, embeds each matching audio file, and writes slide auto-advance timings from audio duration- This is intended for PowerPoint's video export option "Use recorded timings and narrations"- - Voice choices can be listed with `python3 scripts/notes_to_audio.py --list-common-voices` or `python3 scripts/notes_to_audio.py --list-voices --locale zh-CN`+ - Voice choices can be listed with `python3 scripts/notes_to_audio.py --list-common-voices`, `python3 scripts/notes_to_audio.py --list-voices --locale zh-CN`, or provider-specific `--provider <name> --list-voices`- Page transitions are controlled by `-t/--transition`; per-element entrance animations are controlled by `-a/--animation`- Per-element animation applies to top-level SVG `<g id="...">` groups in z-order; aim for 3–8 content groups per slide. Page chrome (background / header / footer / decorations / watermark / page number, by id token) is skipped automatically- Start mode is set by `--animation-trigger`, mirroring PowerPoint's Start dropdown: `after-previous` (default, cascade with `--animation-stagger` spacing on slide entry), `on-click` (presenter-paced), `with-previous` (all together on slide entry)diff --git a/skills/ppt-master/scripts/notes_to_audio.py b/skills/ppt-master/scripts/notes_to_audio.pyindex 5e4bcb90..6d06f478 100644--- a/skills/ppt-master/scripts/notes_to_audio.py+++ b/skills/ppt-master/scripts/notes_to_audio.py@@ -7,29 +7,82 @@ macOS, Linux, and Windows. `edge-tts` remains the default no-key backend.Usage:python3 skills/ppt-master/scripts/notes_to_audio.py <project_path> --voice zh-CN-XiaoxiaoNeuralpython3 skills/ppt-master/scripts/notes_to_audio.py <project_path> --provider elevenlabs --voice-id <voice_id>+ python3 skills/ppt-master/scripts/notes_to_audio.py <project_path> --provider minimax --voice-id <voice_id>+ python3 skills/ppt-master/scripts/notes_to_audio.py <project_path> --provider qwen --voice-id <voice>+ python3 skills/ppt-master/scripts/notes_to_audio.py <project_path> --provider cosyvoice --voice-id <voice>python3 skills/ppt-master/scripts/notes_to_audio.py --list-common-voicespython3 skills/ppt-master/scripts/notes_to_audio.py --list-voices --locale zh-CNDependencies:python3 -m pip install edge-ttsELEVENLABS_API_KEY=<key> for --provider elevenlabs+ MINIMAX_API_KEY=<key> for --provider minimax+ QWEN_API_KEY or DASHSCOPE_API_KEY=<key> for --provider qwen+ COSYVOICE_API_KEY or DASHSCOPE_API_KEY=<key> for --provider cosyvoice"""from __future__ import annotationsimport argparseimport asyncio+import osimport sysfrom dataclasses import dataclassfrom pathlib import Path-from tts_backends import backend_edge, backend_elevenlabs+from tts_backends import (+ backend_cosyvoice,+ backend_edge,+ backend_elevenlabs,+ backend_minimax,+ backend_qwen,+)@dataclass(frozen=True)class AudioBackend:provider: strextension: str+ api_key: str = ""+ voice_id: str = ""+++def _resolve_env_path() -> Path:+ candidates = [+ Path.cwd() / ".env",+ Path(__file__).resolve().parents[3] / ".env",+ Path.home() / ".ppt-master" / ".env",+ ]+ for candidate in candidates:+ if candidate.exists():+ return candidate+ return candidates[0]+++def _load_tts_env_file() -> None:+ """Load TTS-related keys from the first .env file, without overriding shell env."""+ env_path = _resolve_env_path()+ if not env_path.exists():+ return++ prefixes = (+ "ELEVENLABS_",+ "MINIMAX_",+ "QWEN_",+ "DASHSCOPE_",+ "COSYVOICE_",+ )+ for raw in env_path.read_text(encoding="utf-8").splitlines():+ line = raw.strip()+ if not line or line.startswith("#") or "=" not in line:+ continue+ key, value = line.split("=", 1)+ key = key.strip()+ if not any(key.startswith(prefix) for prefix in prefixes):+ continue+ if key in os.environ:+ continue+ os.environ[key] = value.strip().strip("\"'")def spoken_text(markdown: str) -> str:@@ -48,6 +101,8 @@ def spoken_text(markdown: str) -> str:def main() -> int:+ _load_tts_env_file()+parser = argparse.ArgumentParser(description=__doc__,formatter_class=argparse.RawDescriptionHelpFormatter,@@ -56,7 +111,7 @@ def main() -> int:parser.add_argument("-o", "--output", type=Path, default=None)parser.add_argument("--provider",- choices=["edge", "elevenlabs"],+ choices=["edge", "elevenlabs", "minimax", "qwen", "cosyvoice"],default="edge",help="audio generation backend (default: edge)",)@@ -68,12 +123,12 @@ def main() -> int:parser.add_argument("--voice-id",default=None,- help="ElevenLabs voice ID. If omitted for --provider elevenlabs, --voice is used as a fallback.",+ help="provider voice ID/name. If omitted for cloud providers, --voice is used as a fallback.",)parser.add_argument("--rate",default="+0%",- help='edge-tts speaking rate, e.g. "+0%%", "-10%%", "+15%%" (default: +0%%). Ignored by elevenlabs.',+ help='edge-tts speaking rate, e.g. "+0%%", "-10%%", "+15%%" (default: +0%%). Ignored by cloud providers.',)parser.add_argument("--elevenlabs-api-key-env",@@ -114,6 +169,60 @@ def main() -> int:default=None,help="optionally override ElevenLabs speaker boost",)+ parser.add_argument("--minimax-api-key-env", default="MINIMAX_API_KEY",+ help="environment variable containing the MiniMax API key")+ parser.add_argument("--minimax-model", default="speech-2.8-hd",+ help="MiniMax T2A model ID (default: speech-2.8-hd)")+ parser.add_argument("--minimax-base-url", default=None,+ help="MiniMax T2A endpoint or base URL")+ parser.add_argument("--minimax-output-format", default="mp3", choices=["mp3", "wav", "flac", "pcm"],+ help="MiniMax audio format (default: mp3)")+ parser.add_argument("--minimax-sample-rate", type=int, default=32000,+ help="MiniMax sample rate (default: 32000)")+ parser.add_argument("--minimax-bitrate", type=int, default=128000,+ help="MiniMax bitrate in bps (default: 128000)")+ parser.add_argument("--minimax-channel", type=int, default=1,+ help="MiniMax channel count (default: 1)")+ parser.add_argument("--minimax-speed", type=float, default=1.0,+ help="MiniMax speaking speed (default: 1.0)")+ parser.add_argument("--minimax-volume", type=float, default=1.0,+ help="MiniMax volume multiplier (default: 1.0)")+ parser.add_argument("--minimax-pitch", type=int, default=0,+ help="MiniMax pitch adjustment (default: 0)")+ parser.add_argument("--minimax-language-boost", default="auto",+ help="MiniMax language boost (default: auto)")+ parser.add_argument("--qwen-api-key-env", default=None,+ help="environment variable containing the Qwen/DashScope API key")+ parser.add_argument("--qwen-model", default="qwen3-tts-flash",+ help="Qwen TTS model ID (default: qwen3-tts-flash)")+ parser.add_argument("--qwen-base-url", default=None,+ help="Qwen TTS endpoint or base URL")+ parser.add_argument("--qwen-language-type", default="Chinese",+ help="Qwen language_type, e.g. Chinese or English (default: Chinese)")+ parser.add_argument("--qwen-instructions", default=None,+ help="optional Qwen instruction text for supported models")+ parser.add_argument("--qwen-optimize-instructions", action=argparse.BooleanOptionalAction,+ default=None, help="optionally ask Qwen to optimize instructions")+ parser.add_argument("--cosyvoice-api-key-env", default="COSYVOICE_API_KEY",+ help="environment variable containing the CosyVoice/DashScope API key")+ parser.add_argument("--cosyvoice-model", default="cosyvoice-v3-flash",+ help="CosyVoice model ID (default: cosyvoice-v3-flash)")+ parser.add_argument("--cosyvoice-base-url", default=None,+ help="CosyVoice SpeechSynthesizer endpoint or base URL")+ parser.add_argument("--cosyvoice-output-format", default="mp3", choices=["mp3", "wav", "pcm", "opus"],+ help="CosyVoice audio format (default: mp3)")+ parser.add_argument("--cosyvoice-sample-rate", type=int, default=24000,+ help="CosyVoice sample rate (default: 24000)")+ parser.add_argument("--cosyvoice-volume", type=int, default=None,+ help="optional CosyVoice volume, 0-100")+ parser.add_argument("--cosyvoice-rate", type=float, default=None,+ help="optional CosyVoice speaking rate, 0.5-2.0")+ parser.add_argument("--cosyvoice-pitch", type=float, default=None,+ help="optional CosyVoice pitch multiplier, 0.5-2.0")+ parser.add_argument("--cosyvoice-instruction", default=None,+ help="optional CosyVoice instruction text for supported voices/models")+ parser.add_argument("--cosyvoice-language-hint", default=None,+ help="optional CosyVoice language hint, e.g. zh, en, ja")parser.add_argument("--list-common-voices", action="store_true", help="print a curated voice list and exit")parser.add_argument("--list-voices", action="store_true", help="query provider voices and exit")parser.add_argument("--locale", default=None, help='filter --list-voices by locale, e.g. "zh-CN"')@@ -126,7 +235,15 @@ def main() -> int:if args.list_voices:try:if args.provider == "elevenlabs":- backend_elevenlabs.print_voices(backend_elevenlabs.read_api_key(args.elevenlabs_api_key_env))+ backend_elevenlabs.print_voices(+ backend_elevenlabs.read_elevenlabs_api_key(args.elevenlabs_api_key_env)+ )+ elif args.provider == "minimax":+ backend_minimax.print_voices()+ elif args.provider == "qwen":+ backend_qwen.print_voices()+ elif args.provider == "cosyvoice":+ backend_cosyvoice.print_voices()else:asyncio.run(backend_edge.print_voices(args.locale))except Exception as exc:@@ -137,6 +254,8 @@ def main() -> int:if args.project_path is None:parser.error("project_path is required unless --list-voices or --list-common-voices is used")+ voice_id = args.voice_id or args.voice+if args.provider == "edge" and not args.voice:parser.error("--voice is required for --provider edge. Run --list-voices --locale <locale> to discover voices "@@ -145,22 +264,51 @@ def main() -> int:)raise AssertionError("unreachable")+ if args.provider != "edge" and not voice_id:+ parser.error(f"--voice-id is required for --provider {args.provider}")+ raise AssertionError("unreachable")+if args.provider == "elevenlabs":- voice_id = args.voice_id or args.voiceif not voice_id:parser.error("--voice-id is required for --provider elevenlabs")raise AssertionError("unreachable")try:- api_key = backend_elevenlabs.read_api_key(args.elevenlabs_api_key_env)+ api_key = backend_elevenlabs.read_elevenlabs_api_key(args.elevenlabs_api_key_env)extension = backend_elevenlabs.output_extension(args.elevenlabs_output_format)except Exception as exc:print(f"error: {exc}", file=sys.stderr)return 1- backend = AudioBackend(provider=args.provider, extension=extension)+ backend = AudioBackend(provider=args.provider, extension=extension, api_key=api_key, voice_id=voice_id)+ elif args.provider == "minimax":+ try:+ api_key = backend_minimax.read_minimax_api_key(args.minimax_api_key_env)+ extension = backend_minimax.output_extension(args.minimax_output_format)+ except Exception as exc:+ print(f"error: {exc}", file=sys.stderr)+ return 1+ backend = AudioBackend(provider=args.provider, extension=extension, api_key=api_key, voice_id=voice_id)+ elif args.provider == "qwen":+ try:+ api_key = backend_qwen.read_qwen_api_key(args.qwen_api_key_env)+ except Exception as exc:+ print(f"error: {exc}", file=sys.stderr)+ return 1+ backend = AudioBackend(+ provider=args.provider,+ extension=backend_qwen.output_extension(),+ api_key=api_key,+ voice_id=voice_id,+ )+ elif args.provider == "cosyvoice":+ try:+ api_key = backend_cosyvoice.read_cosyvoice_api_key(args.cosyvoice_api_key_env)+ extension = backend_cosyvoice.output_extension(args.cosyvoice_output_format)+ except Exception as exc:+ print(f"error: {exc}", file=sys.stderr)+ return 1+ backend = AudioBackend(provider=args.provider, extension=extension, api_key=api_key, voice_id=voice_id)else:- voice_id = args.voice- api_key = ""- backend = AudioBackend(provider=args.provider, extension=backend_edge.edge_output_extension())+ backend = AudioBackend(provider=args.provider, extension=backend_edge.edge_output_extension(), voice_id=args.voice)project = args.project_pathnotes_dir = project / "notes"@@ -187,8 +335,8 @@ def main() -> int:backend_elevenlabs.generate(text,output_path,- api_key=api_key,- voice_id=voice_id,+ api_key=backend.api_key,+ voice_id=backend.voice_id,model=args.elevenlabs_model,output_format=args.elevenlabs_output_format,stability=args.elevenlabs_stability,@@ -196,6 +344,51 @@ def main() -> int:style=args.elevenlabs_style,speaker_boost=args.elevenlabs_speaker_boost,)+ elif backend.provider == "minimax":+ backend_minimax.generate(+ text,+ output_path,+ api_key=backend.api_key,+ voice_id=backend.voice_id,+ model=args.minimax_model,+ audio_format=args.minimax_output_format,+ sample_rate=args.minimax_sample_rate,+ bitrate=args.minimax_bitrate,+ channel=args.minimax_channel,+ speed=args.minimax_speed,+ volume=args.minimax_volume,+ pitch=args.minimax_pitch,+ language_boost=args.minimax_language_boost,+ base_url=args.minimax_base_url,+ )+ elif backend.provider == "qwen":+ backend_qwen.generate(+ text,+ output_path,+ api_key=backend.api_key,+ voice_id=backend.voice_id,+ model=args.qwen_model,+ language_type=args.qwen_language_type,+ instructions=args.qwen_instructions,+ optimize_instructions=args.qwen_optimize_instructions,+ base_url=args.qwen_base_url,+ )+ elif backend.provider == "cosyvoice":+ backend_cosyvoice.generate(+ text,+ output_path,+ api_key=backend.api_key,+ voice_id=backend.voice_id,+ model=args.cosyvoice_model,+ audio_format=args.cosyvoice_output_format,+ sample_rate=args.cosyvoice_sample_rate,+ volume=args.cosyvoice_volume,+ rate=args.cosyvoice_rate,+ pitch=args.cosyvoice_pitch,+ instruction=args.cosyvoice_instruction,+ language_hint=args.cosyvoice_language_hint,+ base_url=args.cosyvoice_base_url,+ )else:asyncio.run(backend_edge.generate(text, output_path, voice=args.voice, rate=args.rate))except Exception as exc:diff --git a/skills/ppt-master/scripts/tts_backends/backend_common.py b/skills/ppt-master/scripts/tts_backends/backend_common.pynew file mode 100644index 00000000..2d2298f4--- /dev/null+++ b/skills/ppt-master/scripts/tts_backends/backend_common.py@@ -0,0 +1,68 @@+"""Shared helpers for TTS backends."""++from __future__ import annotations++import json+import os+from pathlib import Path+from urllib import error, request+++def read_api_key(*env_names: str, label: str) -> str:+ for env_name in env_names:+ api_key = os.environ.get(env_name, "").strip()+ if api_key:+ return api_key+ joined = " or ".join(env_names)+ raise RuntimeError(f"Missing {label} API key. Set {joined}=<key>.")+++def read_http_error(exc: error.HTTPError) -> str:+ try:+ body = exc.read().decode("utf-8", errors="replace")+ except Exception:+ body = ""+ return f"HTTP {exc.code}: {body or exc.reason}"+++def post_json(url: str, *, headers: dict[str, str], payload: dict, timeout: int = 120) -> dict:+ body = json.dumps(payload, ensure_ascii=False).encode("utf-8")+ req = request.Request(+ url,+ data=body,+ headers={+ "Content-Type": "application/json",+ **headers,+ },+ method="POST",+ )+ try:+ with request.urlopen(req, timeout=timeout) as response:+ return json.loads(response.read().decode("utf-8"))+ except error.HTTPError as exc:+ raise RuntimeError(read_http_error(exc)) from exc+ except error.URLError as exc:+ raise RuntimeError(f"HTTP request failed: {exc.reason}") from exc+++def get_bytes(url: str, *, timeout: int = 180) -> bytes:+ req = request.Request(url, method="GET")+ try:+ with request.urlopen(req, timeout=timeout) as response:+ return response.read()+ except error.HTTPError as exc:+ raise RuntimeError(read_http_error(exc)) from exc+ except error.URLError as exc:+ raise RuntimeError(f"Audio download failed: {exc.reason}") from exc+++def download_audio(url: str, output_path: Path) -> None:+ output_path.write_bytes(get_bytes(url))+++def extension_from_format(audio_format: str) -> str:+ normalized = audio_format.strip().lower()+ if normalized in {"mp3", "wav", "flac", "pcm", "opus"}:+ return f".{normalized}"+ raise RuntimeError(f"Unsupported audio format for PPT narration: {audio_format}")+diff --git a/skills/ppt-master/scripts/tts_backends/backend_cosyvoice.py b/skills/ppt-master/scripts/tts_backends/backend_cosyvoice.pynew file mode 100644index 00000000..bb784ebc--- /dev/null+++ b/skills/ppt-master/scripts/tts_backends/backend_cosyvoice.py@@ -0,0 +1,83 @@+"""Alibaba CosyVoice backend for narration audio generation."""++from __future__ import annotations++import os+from pathlib import Path++from tts_backends.backend_common import download_audio, extension_from_format, post_json, read_api_key+++DEFAULT_ENDPOINT = "https://dashscope.aliyuncs.com/api/v1/services/audio/tts/SpeechSynthesizer"+DEFAULT_MODEL = "cosyvoice-v3-flash"+++def output_extension(audio_format: str) -> str:+ return extension_from_format(audio_format)+++def read_cosyvoice_api_key(env_name: str) -> str:+ env_names = tuple(dict.fromkeys([env_name, "COSYVOICE_API_KEY", "DASHSCOPE_API_KEY"]))+ return read_api_key(*env_names, label="CosyVoice/DashScope")+++def resolve_url(base_url: str | None = None) -> str:+ base = (base_url or os.environ.get("COSYVOICE_TTS_BASE_URL") or DEFAULT_ENDPOINT).rstrip("/")+ if base.endswith("/SpeechSynthesizer"):+ return base+ return base + "/api/v1/services/audio/tts/SpeechSynthesizer"+++def generate(+ text: str,+ output_path: Path,+ *,+ api_key: str,+ voice_id: str,+ model: str,+ audio_format: str,+ sample_rate: int,+ volume: int | None,+ rate: float | None,+ pitch: float | None,+ instruction: str | None,+ language_hint: str | None,+ base_url: str | None,+) -> None:+ input_payload: dict[str, object] = {+ "text": text,+ "voice": voice_id,+ "format": audio_format,+ "sample_rate": sample_rate,+ }+ if volume is not None:+ input_payload["volume"] = volume+ if rate is not None:+ input_payload["rate"] = rate+ if pitch is not None:+ input_payload["pitch"] = pitch+ if instruction:+ input_payload["instruction"] = instruction+ if language_hint:+ input_payload["language_hints"] = [language_hint]++ data = post_json(+ resolve_url(base_url),+ headers={"Authorization": f"Bearer {api_key}"},+ payload={+ "model": model,+ "input": input_payload,+ },+ timeout=180,+ )+ audio = (data.get("output") or {}).get("audio") or {}+ audio_url = audio.get("url")+ if not audio_url:+ raise RuntimeError(f"CosyVoice response missing audio URL: {data}")+ download_audio(audio_url, output_path)+++def print_voices() -> None:+ print("CosyVoice voices are selected by voice.")+ print("Use a system voice name or a cloned/designed voice_id from CosyVoice.")+ print("Example system voice from Alibaba Cloud docs: longanyang")diff --git a/skills/ppt-master/scripts/tts_backends/backend_elevenlabs.py b/skills/ppt-master/scripts/tts_backends/backend_elevenlabs.pyindex a044b9cd..f0d61343 100644--- a/skills/ppt-master/scripts/tts_backends/backend_elevenlabs.py+++ b/skills/ppt-master/scripts/tts_backends/backend_elevenlabs.py@@ -3,19 +3,17 @@from __future__ import annotationsimport json-import osfrom pathlib import Pathfrom urllib import error, request+from tts_backends.backend_common import read_api_key+API_BASE = "https://api.elevenlabs.io/v1"-def read_api_key(env_name: str) -> str:- api_key = os.environ.get(env_name, "").strip()- if not api_key:- raise RuntimeError(f"Missing ElevenLabs API key. Set {env_name}=<key>.")- return api_key+def read_elevenlabs_api_key(env_name: str) -> str:+ return read_api_key(env_name, label="ElevenLabs")def output_extension(output_format: str) -> str:@@ -108,4 +106,3 @@ def print_voices(api_key: str) -> None:name = item.get("name", "")category = item.get("category", "")print(f"{voice_id:<23} {name:<29} {category}")-diff --git a/skills/ppt-master/scripts/tts_backends/backend_minimax.py b/skills/ppt-master/scripts/tts_backends/backend_minimax.pynew file mode 100644index 00000000..0502c3ab--- /dev/null+++ b/skills/ppt-master/scripts/tts_backends/backend_minimax.py@@ -0,0 +1,92 @@+"""MiniMax T2A backend for narration audio generation."""++from __future__ import annotations++import binascii+import os+from pathlib import Path++from tts_backends.backend_common import extension_from_format, post_json, read_api_key+++DEFAULT_ENDPOINT = "https://api.minimax.io/v1/t2a_v2"+DEFAULT_MODEL = "speech-2.8-hd"+++def output_extension(audio_format: str) -> str:+ return extension_from_format(audio_format)+++def read_minimax_api_key(env_name: str) -> str:+ return read_api_key(env_name, label="MiniMax")+++def resolve_url(base_url: str | None = None) -> str:+ base = (base_url or os.environ.get("MINIMAX_TTS_BASE_URL") or DEFAULT_ENDPOINT).rstrip("/")+ if base.endswith("/t2a_v2"):+ return base+ if base.endswith("/v1"):+ return base + "/t2a_v2"+ return base + "/v1/t2a_v2"+++def generate(+ text: str,+ output_path: Path,+ *,+ api_key: str,+ voice_id: str,+ model: str,+ audio_format: str,+ sample_rate: int,+ bitrate: int,+ channel: int,+ speed: float,+ volume: float,+ pitch: int,+ language_boost: str,+ base_url: str | None,+) -> None:+ payload = {+ "model": model,+ "text": text,+ "stream": False,+ "language_boost": language_boost,+ "output_format": "hex",+ "voice_setting": {+ "voice_id": voice_id,+ "speed": speed,+ "vol": volume,+ "pitch": pitch,+ },+ "audio_setting": {+ "sample_rate": sample_rate,+ "bitrate": bitrate,+ "format": audio_format,+ "channel": channel,+ },+ }+ data = post_json(+ resolve_url(base_url),+ headers={"Authorization": f"Bearer {api_key}"},+ payload=payload,+ timeout=180,+ )+ base_resp = data.get("base_resp") or {}+ if base_resp.get("status_code") not in (None, 0, "0"):+ raise RuntimeError(f"MiniMax TTS failed: {data}")++ audio_hex = (data.get("data") or {}).get("audio")+ if not audio_hex:+ raise RuntimeError(f"MiniMax response missing audio data: {data}")+ try:+ output_path.write_bytes(binascii.unhexlify(audio_hex))+ except (binascii.Error, ValueError) as exc:+ raise RuntimeError("MiniMax response audio is not valid hex data") from exc+++def print_voices() -> None:+ print("MiniMax TTS voices are selected by voice_id.")+ print("Use a system voice ID or a cloned voice_id from MiniMax Voice Clone.")+ print("Example system voice from MiniMax docs: English_expressive_narrator")+diff --git a/skills/ppt-master/scripts/tts_backends/backend_qwen.py b/skills/ppt-master/scripts/tts_backends/backend_qwen.pynew file mode 100644index 00000000..04f2c413--- /dev/null+++ b/skills/ppt-master/scripts/tts_backends/backend_qwen.py@@ -0,0 +1,75 @@+"""Alibaba Qwen TTS backend for narration audio generation."""++from __future__ import annotations++import os+from pathlib import Path++from tts_backends.backend_common import download_audio, post_json, read_api_key+++DEFAULT_ENDPOINT = "https://dashscope-intl.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generation"+DEFAULT_MODEL = "qwen3-tts-flash"+++def output_extension() -> str:+ return ".wav"+++def read_qwen_api_key(env_name: str | None = None) -> str:+ if env_name:+ return read_api_key(env_name, label="Qwen/DashScope")+ return read_api_key("QWEN_API_KEY", "DASHSCOPE_API_KEY", label="Qwen/DashScope")+++def resolve_url(base_url: str | None = None) -> str:+ base = (base_url or os.environ.get("QWEN_TTS_BASE_URL") or DEFAULT_ENDPOINT).rstrip("/")+ if base.endswith("/generation"):+ return base+ return base + "/api/v1/services/aigc/multimodal-generation/generation"+++def generate(+ text: str,+ output_path: Path,+ *,+ api_key: str,+ voice_id: str,+ model: str,+ language_type: str,+ instructions: str | None,+ optimize_instructions: bool | None,+ base_url: str | None,+) -> None:+ input_payload: dict[str, object] = {+ "text": text,+ "voice": voice_id,+ }+ if language_type:+ input_payload["language_type"] = language_type+ if instructions:+ input_payload["instructions"] = instructions+ if optimize_instructions is not None:+ input_payload["optimize_instructions"] = optimize_instructions++ data = post_json(+ resolve_url(base_url),+ headers={"Authorization": f"Bearer {api_key}"},+ payload={+ "model": model,+ "input": input_payload,+ },+ timeout=180,+ )+ audio = (data.get("output") or {}).get("audio") or {}+ audio_url = audio.get("url")+ if not audio_url:+ raise RuntimeError(f"Qwen TTS response missing audio URL: {data}")+ download_audio(audio_url, output_path)+++def print_voices() -> None:+ print("Qwen TTS voices are selected by voice.")+ print("Use a system voice name or a cloned voice from Qwen voice cloning.")+ print("Example system voice from Alibaba Cloud docs: Cherry")+diff --git a/skills/ppt-master/workflows/generate-audio.md b/skills/ppt-master/workflows/generate-audio.mdindex 9e3c0c26..fb7fd9a4 100644--- a/skills/ppt-master/workflows/generate-audio.md+++ b/skills/ppt-master/workflows/generate-audio.md@@ -4,7 +4,7 @@ description: Generate per-slide narration audio with AI-recommended voice select# Generate Audio Workflow-> Standalone post-export step. Run when the user asks for "生成音频" / "录制旁白" / "narrated PPT" / "video export with voice", or proactively offer it after a deck is exported. Produces one audio file per slide via `edge-tts` by default, or ElevenLabs when the user chooses high-quality cloud narration, then optionally re-exports the PPTX with the audio embedded and per-slide auto-advance timings.+> Standalone post-export step. Run when the user asks for "生成音频" / "录制旁白" / "narrated PPT" / "video export with voice", or proactively offer it after a deck is exported. Produces one audio file per slide via `edge-tts` by default, or a cloud TTS provider (`elevenlabs` / `minimax` / `qwen` / `cosyvoice`) when the user chooses high-quality narration or a cloned voice, then optionally re-exports the PPTX with the audio embedded and per-slide auto-advance timings.This workflow is **independent**: it reads `notes/*.md` and queries the selected TTS voice catalog — no upstream conversation context required. Safe to invoke in a fresh session.@@ -12,7 +12,11 @@ This workflow is **independent**: it reads `notes/*.md` and queries the selected- `notes/total.md` exists and has been split into per-page files at `notes/*.md` (post-processing Step 7.1 done).- Default mode: `edge-tts` is installed (`python3 -m pip install edge-tts`).-- High-quality cloud mode: `ELEVENLABS_API_KEY` is set before using `--provider elevenlabs`.+- High-quality cloud mode: provider API key is set before use:+ - ElevenLabs: `ELEVENLABS_API_KEY`+ - MiniMax: `MINIMAX_API_KEY`+ - Qwen: `QWEN_API_KEY` or `DASHSCOPE_API_KEY`+ - CosyVoice: `COSYVOICE_API_KEY` or `DASHSCOPE_API_KEY`- The deck is in a single dominant language (mixed-language decks: pick the dominant one — the AI uses judgment, not a heuristic).If `notes/*.md` are missing, run `total_md_split.py <project_path>` first.@@ -31,7 +35,7 @@ The AI already knows the deck's language from writing the notes. No detection sc## Step 2: Choose audio backend and pull the voice catalog-Default to **edge** unless the user explicitly asks for ElevenLabs / higher-quality cloud narration / custom ElevenLabs voice.+Default to **edge** unless the user explicitly asks for a cloud provider / higher-quality cloud narration / a cloned voice.**edge backend**:@@ -45,11 +49,20 @@ python3 skills/ppt-master/scripts/notes_to_audio.py --list-voices --locale <locapython3 skills/ppt-master/scripts/notes_to_audio.py --provider elevenlabs --list-voices```+**Cloud providers using explicit voice IDs/names**:++```bash+python3 skills/ppt-master/scripts/notes_to_audio.py --provider minimax --list-voices+python3 skills/ppt-master/scripts/notes_to_audio.py --provider qwen --list-voices+python3 skills/ppt-master/scripts/notes_to_audio.py --provider cosyvoice --list-voices+```+The output is a flat list of all available voices for the selected provider. From this list, the AI picks **3–6 candidates** to recommend, applying these rules:- **Cover both genders** when both exist for the locale.- **For edge**: prefer `COMMON_VOICES`-listed voices (curated set inside `notes_to_audio.py`) when the locale has them — they are battle-tested.- **For ElevenLabs**: prefer voices already present in the user's account; if the user provides a specific `voice_id`, do not override it.+- **For MiniMax / Qwen / CosyVoice**: if the user provides a cloned `voice_id`, use it directly. Do not attempt voice cloning inside the narration workflow.- **Match the deck's tone** — pick the strongest recommendation based on style:- Consultant / data-driven / 财报 → 稳重男声(如 `zh-CN-YunjianNeural`)or 清晰女声(如 `zh-CN-XiaoxiaoNeural`)- General / 教学 / 产品介绍 → 明亮女声 / 年轻男声(如 `zh-CN-XiaoyiNeural` / `zh-CN-YunxiNeural`)@@ -57,7 +70,7 @@ The output is a flat list of all available voices for the selected provider. Fro- English consultant deck → `en-US-GuyNeural` (steady) or `en-US-JennyNeural` (clear)- Japanese / Korean → pick from `ja-JP-*` / `ko-KR-*` neural voices, mark gender + tone-For each candidate, write a **one-line Chinese description** covering: 性别 · 调性 · 适用场景。For ElevenLabs, include the voice name and `voice_id`.+For each candidate, write a **one-line Chinese description** covering: 性别 · 调性 · 适用场景。For cloud providers, include the voice name/ID exactly as it must be passed to `--voice-id`.---@@ -69,7 +82,7 @@ Send a single message to the user that asks all three questions at once and prov> 检测到 notes 主语言为 **<语言>**(locale: `<locale>`)。基于 deck 调性(<风格>),我推荐以下配置:>-> **生成模式**:⭐ 推荐 `<edge|elevenlabs>`(理由:<一句话,如"无需配置,稳定生成"或"用户要求高质量云端音色">)。+> **生成模式**:⭐ 推荐 `<edge|elevenlabs|minimax|qwen|cosyvoice>`(理由:<一句话,如"无需配置,稳定生成"或"用户要求高质量云端音色">)。>> **音色**:> - **[1] <ShortName>** — <性别·调性·适用场景> ⭐ **推荐**@@ -83,12 +96,12 @@ Send a single message to the user that asks all three questions at once and prov>> **生成完是否重新导出嵌入音频的 PPTX**:⭐ 推荐 **是**(一次到位,自动按音频时长设页面停留)。>-> 直接回"好"用全部推荐值,或告诉我想改的部分(如"音色 2,语速 -5%"或"用 ElevenLabs 的 voice_id xxx")。+> 直接回"好"用全部推荐值,或告诉我想改的部分(如"音色 2,语速 -5%"或"用 MiniMax 的 voice_id xxx")。**Recommended-value rules**:-- 生成模式:默认 `edge`;当用户明确追求高质量云端音色或提供 ElevenLabs voice ID 时用 `elevenlabs`。+- 生成模式:默认 `edge`;当用户明确追求高质量云端音色或提供 cloud voice ID 时,按用户指定选 `elevenlabs` / `minimax` / `qwen` / `cosyvoice`。- 音色:从 Step 2 候选里挑最贴合 deck 调性的那一个。-- 语速:edge 默认 `+0%`;notes 字数密集(页均 >4 句长句)建议 `-5%`;notes 简短紧凑建议 `+5%`;超出此范围需说明理由。ElevenLabs 默认不传 voice settings,除非用户明确要更稳定/更夸张。+- 语速:edge 默认 `+0%`;notes 字数密集(页均 >4 句长句)建议 `-5%`;notes 简短紧凑建议 `+5%`;超出此范围需说明理由。Cloud providers 默认用 provider defaults,除非用户明确要调速或改风格。- 嵌入:默认推荐"是";除非用户已有定制 PPTX 不希望覆盖。---@@ -107,12 +120,27 @@ python3 skills/ppt-master/scripts/notes_to_audio.py <project_path> \--provider elevenlabs --voice-id <chosen-voice-id> \--elevenlabs-model eleven_multilingual_v2+# 1C. Or generate audio with MiniMax+python3 skills/ppt-master/scripts/notes_to_audio.py <project_path> \+ --provider minimax --voice-id <chosen-voice-id> \+ --minimax-model speech-2.8-hd++# 1D. Or generate audio with Qwen TTS+python3 skills/ppt-master/scripts/notes_to_audio.py <project_path> \+ --provider qwen --voice-id <chosen-voice> \+ --qwen-model qwen3-tts-flash --qwen-language-type Chinese++# 1E. Or generate audio with CosyVoice+python3 skills/ppt-master/scripts/notes_to_audio.py <project_path> \+ --provider cosyvoice --voice-id <chosen-voice> \+ --cosyvoice-model cosyvoice-v3-flash+# 2. (If user kept embedding) Re-export PPTX with audio embeddedpython3 skills/ppt-master/scripts/svg_to_pptx.py <project_path> -s final \--recorded-narration audio```-If `notes_to_audio.py` errors with a missing dependency or missing `ELEVENLABS_API_KEY`, fix the prerequisite and re-run — do NOT swallow the error.+If `notes_to_audio.py` errors with a missing dependency or missing provider API key, fix the prerequisite and re-run — do NOT swallow the error.---