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(narration): synchronize animation and final video subtitles
hugohe3c62e0c77ab5f
diff --git a/skills/ppt-master/references/animations.md b/skills/ppt-master/references/animations.mdindex 026017ce..3d53820e 100644--- a/skills/ppt-master/references/animations.md+++ b/skills/ppt-master/references/animations.md@@ -148,9 +148,10 @@ Flags:- `--animation-trigger` — Start mode (matches PowerPoint): `on-click`, `with-previous`, or `after-previous` (default).- `--animation-duration` — per-element entrance seconds, default `0.4`.- `--animation-stagger` — gap between elements in `after-previous` mode (seconds, default `0.5`). Ignored otherwise.-- `--animation-config` — sidecar path. Default: `<project>/animations.json` when present.+- `--animation-config` — explicit sidecar path. Narrated export defaults to `<project>/narration_animations.json`; other export defaults to `<project>/animations.json` when present.+- `--no-animations` — ignore animation sidecars and disable both object animations and page-transition motion. Narration audio and recorded slide-advance timing remain active.-> Note: `--recorded-narration` rejects `on-click`; use `after-previous` or `with-previous` for video-ready narrated decks.+> Note: `--recorded-narration` rejects `on-click`; use its default `narration_animations.json`, pass `--animation-config animations.json` for the canonical presentation animation, or pass `--no-animations`.---@@ -199,6 +200,9 @@ Narration injection merges audio timing into an existing direct `p:sld/p:timing`| Slower transition | `--transition-duration 0.8` || Auto-play | `--auto-advance 5` || Disable element animation | `-a none` |+| Narrated export with synchronized animation | `--recorded-narration audio` |+| Narrated export with canonical animation | `--recorded-narration audio --animation-config animations.json` |+| Narrated export without animation motion | `--recorded-narration audio --no-animations` || Switch to on-click trigger | `-a auto --animation-trigger on-click` || Use a single effect instead of auto | `--animation fade` || All groups animate together | `-a auto --animation-trigger with-previous` |diff --git a/skills/ppt-master/scripts/docs/svg-pipeline.md b/skills/ppt-master/scripts/docs/svg-pipeline.mdindex 9105fb16..ce104495 100644--- a/skills/ppt-master/scripts/docs/svg-pipeline.md+++ b/skills/ppt-master/scripts/docs/svg-pipeline.md@@ -294,6 +294,8 @@ python3 scripts/svg_to_pptx.py <project_path> --auto-advance 3python3 scripts/svg_to_pptx.py <project_path> --animation mixed --animation-duration 0.8python3 scripts/svg_to_pptx.py <project_path> --no-merge # strict line-fidelity mode (see below)python3 scripts/svg_to_pptx.py <project_path> --recorded-narration audio+python3 scripts/svg_to_pptx.py <project_path> --recorded-narration audio --animation-config animations.json+python3 scripts/svg_to_pptx.py <project_path> --recorded-narration audio --no-animations```The normal command reads `pptx_structure.mode` from `spec_lock.md`. For legacy@@ -357,6 +359,8 @@ Behavior:- 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` prepares PowerPoint's "recorded timings and narrations": every slide must have matching `m4a` / `mp3` / `wav` audio, `ffprobe` must read every duration, and `--animation-trigger on-click` is rejected- `--recorded-narration audio` keeps speaker notes, embeds each matching audio file, and writes slide auto-advance timings from audio duration+ - Narrated export defaults to `<project>/narration_animations.json`; pass `--animation-config animations.json` for the canonical presentation animation, or `--no-animations` to remove object animations and page-transition motion while retaining narration and slide timings+ - Non-narrated export keeps the existing optional `<project>/animations.json` default- Narration timing is merged into the existing slide timing DOM; object entrance rows and the resolved page transition are preserved rather than regenerated- `--narration-audio-dir audio` is the lower-level embedding path: it embeds whatever files match and allows partial audio coverage- Either narration flag names the default-flow export `<project_name>_<timestamp>_narrated.pptx`, telling it apart from silent exports in the same directorydiff --git a/skills/ppt-master/scripts/narration_sync.py b/skills/ppt-master/scripts/narration_sync.pyindex 73546d6f..91fd13dc 100644--- a/skills/ppt-master/scripts/narration_sync.py+++ b/skills/ppt-master/scripts/narration_sync.py@@ -2,20 +2,21 @@"""PPT Master - Narration Sync Tool-Rebuild click-free object timing from page-local SRT cues, then merge those-subtitles against timing values read from the final narrated PPTX.+Derive click-free narration timing from the canonical animation config and+page-local SRT cues, then merge those subtitles against timing values read+from the final narrated PPTX.See workflows/stages/generate-audio.md for the owning stage.Usage:python3 scripts/narration_sync.py fingerprint <project_path>- python3 scripts/narration_sync.py animations <project_path> --force+ python3 scripts/narration_sync.py animations <project_path>python3 scripts/narration_sync.py subtitles <project_path> --pptx <pptx> --forcepython3 scripts/narration_sync.py subtitles <project_path> --pptx <pptx> \--video <powerpoint_video> --forceExamples:python3 scripts/narration_sync.py fingerprint projects/demo- python3 scripts/narration_sync.py animations projects/demo --force+ python3 scripts/narration_sync.py animations projects/demopython3 scripts/narration_sync.py subtitles projects/demo --pptx exports/demo.pptx --forcepython3 scripts/narration_sync.py subtitles projects/demo \--pptx exports/demo.pptx --video exports/demo.mp4 --force@@ -28,6 +29,7 @@ Dependencies:from __future__ import annotationsimport argparse+import copyimport hashlibimport jsonimport math@@ -49,8 +51,17 @@ if str(_SCRIPTS_DIR) not in sys.path:sys.path.insert(0, str(_SCRIPTS_DIR))from console_encoding import configure_utf8_stdio # noqa: E402+from pptx_animations import ( # noqa: E402+ animation_seconds_to_milliseconds,+ normalize_animation_effect,+)from pptx_transitions import read_slide_transition_xml # noqa: E402-from svg_to_pptx.animation_config import scan_project_targets # noqa: E402+from svg_to_pptx.animation_config import ( # noqa: E402+ scan_project_targets,+ scan_svg_targets,+ validate_animation_config_errors,+ validate_transition_config,+)from svg_to_pptx.pptx_package.narration import ( # noqa: E402NARRATION_EXTENSIONS,probe_audio_duration,@@ -68,29 +79,6 @@ _TIMING_RE = re.compile(r"^(?P<start>\d+:\d{2}:\d{2},\d{3})\s+-->\s+"r"(?P<end>\d+:\d{2}:\d{2},\d{3})(?:\s+.*)?$")-_RHYTHM_RE = re.compile(r"^-\s*P(?P<page>\d+)\s*:\s*(?P<rhythm>[a-z-]+)\s*$")-_RHYTHM_PROFILES = {- "dense": {- "transition_duration": 0.3,- "animation_duration": 0.35,- "stagger": 0.18,- },- "anchor": {- "transition_duration": 0.5,- "animation_duration": 0.5,- "stagger": 0.3,- },- "breathing": {- "transition_duration": 0.5,- "animation_duration": 0.6,- "stagger": 0.3,- },-}-_DEFAULT_PROFILE = {- "transition_duration": 0.4,- "animation_duration": 0.4,- "stagger": 0.25,-}_ALIGNMENT_SAMPLE_RATE = 8000_ALIGNMENT_FINE_HZ = 1000_ALIGNMENT_COARSE_FACTOR = 10@@ -112,12 +100,46 @@ class SubtitleCue:@dataclass(frozen=True)class TimingPlanEntry:- """One ordered SVG animation target and its optional SRT cue anchor."""+ """One ordered animation target and its optional SRT cue anchor."""group_id: strcue_number: int | None+@dataclass(frozen=True)+class AnimationGroupState:+ """One effective canonical animation row before narration timing."""++ group_id: str+ order: int+ source_index: int+ duration_ms: int+ original_delay_ms: int+++@dataclass(frozen=True)+class SlideAnimationSettings:+ """Effective animation settings inherited by one slide."""++ effect: str | None+ duration_ms: int+ stagger_ms: int+ trigger: str+++@dataclass(frozen=True)+class AnimationBuildResult:+ """Summary of one narration animation derivation."""++ slide_count: int+ group_count: int+ anchored_count: int+ fallback_count: int+ ignored_cue_count: int+ svg_fallback_slide_count: int+ timing_plan_written: bool++@dataclass(frozen=True)class SubtitleMergeResult:"""Summary of one page-local SRT merge."""@@ -328,9 +350,9 @@ def _load_timing_plan(f'Narration timing plan slide "{slide_name}" must contain only "groups"')groups = slide_raw["groups"]- if not isinstance(groups, list) or not groups:+ if not isinstance(groups, list):raise ValueError(- f'Narration timing plan slide "{slide_name}" groups must be a non-empty list'+ f'Narration timing plan slide "{slide_name}" groups must be a list')entries: list[TimingPlanEntry] = []@@ -373,39 +395,341 @@ def _load_timing_plan(return srt_sha256, float(narration_padding), result-def _load_page_rhythms(path: Path) -> dict[int, str]:- if not path.exists():- return {}- rhythms: dict[int, str] = {}- in_section = False- for line in path.read_text(encoding="utf-8").splitlines():- if line.startswith("## "):- in_section = line.strip() == "## page_rhythm"- continue- if not in_section:- continue- match = _RHYTHM_RE.match(line.strip())- if match is None:+def _load_canonical_animation_config(path: Path) -> dict[str, Any]:+ """Load and field-validate the read-only canonical animation sidecar."""+ if not path.is_file():+ raise FileNotFoundError(+ f"Canonical animation config is missing: {path}. "+ "Complete the customize-animations stage first; narration sync "+ "does not create or replace animations.json."+ )+ raw = json.loads(path.read_text(encoding="utf-8"))+ if not isinstance(raw, dict):+ raise ValueError(f"Canonical animation config must be a JSON object: {path}")+ if raw.get("version", 1) != 1:+ raise ValueError(+ f"Unsupported canonical animation config version: {raw.get('version')!r}"+ )+ errors = list(+ dict.fromkeys(+ [+ *validate_transition_config(raw),+ *validate_animation_config_errors(raw),+ ]+ )+ )+ if errors:+ details = "\n".join(f"- {error}" for error in errors)+ raise ValueError(+ f"Canonical animation config is invalid: {path}\n{details}"+ )+ return raw+++def _page_subtitle_names(subtitle_dir: Path) -> list[str]:+ """Return ordered page-local SRT stems, excluding the merged sidecar."""+ if not subtitle_dir.is_dir():+ raise FileNotFoundError(f"Page-local SRT directory not found: {subtitle_dir}")+ names = [+ path.stem+ for path in sorted(subtitle_dir.glob("*.srt"))+ if path.stem != "total"+ ]+ if not names:+ raise FileNotFoundError(f"No page-local SRT files found under: {subtitle_dir}")+ return names+++def _animation_slide_names(+ project_path: Path,+ config: dict[str, Any],+ subtitle_dir: Path,+) -> list[str]:+ """Resolve the page roster without parsing SVG unless a slide is missing."""+ slides = config.get("slides", {})+ if not isinstance(slides, dict):+ raise ValueError('Canonical animations.json field "slides" must be an object')+ canonical_names = list(slides)+ subtitle_names = _page_subtitle_names(subtitle_dir)+ subtitle_set = set(subtitle_names)++ missing_subtitles = [+ slide_name for slide_name in canonical_names if slide_name not in subtitle_set+ ]+ if missing_subtitles:+ raise FileNotFoundError(+ "Missing page-local SRT for canonical animation slide(s): "+ + ", ".join(missing_subtitles)+ )++ canonical_set = set(canonical_names)+ extra_subtitles = [+ slide_name for slide_name in subtitle_names if slide_name not in canonical_set+ ]+ unexpected = [+ slide_name+ for slide_name in extra_subtitles+ if not (project_path / "svg_output" / f"{slide_name}.svg").is_file()+ ]+ if unexpected:+ raise ValueError(+ "Page-local SRT has no matching canonical animation slide or SVG: "+ + ", ".join(unexpected)+ )+ if not extra_subtitles:+ return canonical_names+ return subtitle_names+++def _animation_scope(+ scope: dict[str, Any],+ *,+ label: str,+) -> dict[str, Any]:+ value = scope.get("animation", {})+ if not isinstance(value, dict):+ raise ValueError(f'{label} field "animation" must be an object')+ return value+++def _effective_slide_animation(+ config: dict[str, Any],+ slide_cfg: dict[str, Any],+) -> SlideAnimationSettings:+ defaults = config.get("defaults", {})+ if not isinstance(defaults, dict):+ raise ValueError('Canonical animations.json field "defaults" must be an object')+ default_animation = _animation_scope(+ defaults,+ label="Canonical animations.json defaults",+ )+ slide_animation = _animation_scope(+ slide_cfg,+ label="Canonical animations.json slide",+ )+ effect = normalize_animation_effect(+ slide_animation.get(+ "effect",+ default_animation.get("effect", "none"),+ )+ )+ duration_ms = animation_seconds_to_milliseconds(+ slide_animation.get(+ "duration",+ default_animation.get("duration", 0.4),+ ),+ "canonical animation duration",+ allow_zero=False,+ )+ stagger_ms = animation_seconds_to_milliseconds(+ slide_animation.get(+ "stagger",+ default_animation.get("stagger", 0.5),+ ),+ "canonical animation stagger",+ allow_zero=True,+ )+ trigger = slide_animation.get(+ "trigger",+ default_animation.get("trigger", "after-previous"),+ )+ if not isinstance(trigger, str):+ raise ValueError(f"Canonical animation trigger must be a string: {trigger!r}")+ return SlideAnimationSettings(+ effect=effect,+ duration_ms=duration_ms,+ stagger_ms=stagger_ms,+ trigger=trigger,+ )+++def _group_is_animated(+ group_cfg: dict[str, Any],+ slide_effect: str | None,+) -> bool:+ if "effect" not in group_cfg:+ return slide_effect is not None+ return normalize_animation_effect(group_cfg["effect"]) is not None+++def _needs_svg_group_resolution(+ settings: SlideAnimationSettings,+ groups_cfg: dict[str, Any],+ plan_entries: list[TimingPlanEntry] | None,+) -> bool:+ """Return whether JSON alone cannot prove the effective group sequence."""+ active_explicit = [+ group_id+ for group_id, group_cfg in groups_cfg.items()+ if isinstance(group_cfg, dict)+ and _group_is_animated(group_cfg, settings.effect)+ ]+ if plan_entries is None:+ if settings.effect is not None:+ return True+ return (+ len(active_explicit) > 1+ and any("order" not in groups_cfg[group_id] for group_id in active_explicit)+ )++ candidate_ids = list(+ dict.fromkeys(+ [+ *(entry.group_id for entry in plan_entries),+ *active_explicit,+ ]+ )+ )+ active_candidates = [+ group_id+ for group_id in candidate_ids+ if group_id in groups_cfg+ and isinstance(groups_cfg[group_id], dict)+ and _group_is_animated(groups_cfg[group_id], settings.effect)+ ]+ if len(active_candidates) <= 1:+ return False+ return any("order" not in groups_cfg[group_id] for group_id in active_candidates)+++def _resolve_animation_groups(+ project_path: Path,+ slide_name: str,+ slide_cfg: dict[str, Any],+ settings: SlideAnimationSettings,+ plan_entries: list[TimingPlanEntry] | None,+) -> tuple[list[AnimationGroupState], bool]:+ """Resolve one effective sequence, parsing only an ambiguous page SVG."""+ groups_value = slide_cfg.get("groups", {})+ if not isinstance(groups_value, dict):+ raise ValueError(+ f'Canonical animations.json slide "{slide_name}" groups must be an object'+ )+ groups_cfg: dict[str, dict[str, Any]] = {}+ for group_id, group_cfg in groups_value.items():+ if not isinstance(group_cfg, dict):+ raise ValueError(+ f'Canonical animations.json group "{slide_name}/{group_id}" '+ "must be an object"+ )+ groups_cfg[group_id] = group_cfg++ use_svg = _needs_svg_group_resolution(settings, groups_cfg, plan_entries)+ candidate_ids: list[str]+ if use_svg:+ svg_path = project_path / "svg_output" / f"{slide_name}.svg"+ if not svg_path.is_file():+ raise FileNotFoundError(+ f"Animation group mapping is ambiguous and requires the page SVG: "+ f"{svg_path}"+ )+ targets, anonymous_groups = scan_svg_targets(svg_path)+ duplicate_ids = sorted(+ group_id+ for group_id in {target.group_id for target in targets}+ if sum(target.group_id == group_id for target in targets) > 1+ )+ if duplicate_ids:+ raise ValueError(+ f'SVG slide "{slide_name}" has duplicate top-level group id(s): '+ + ", ".join(duplicate_ids)+ )+ for item in anonymous_groups:+ print(+ f"Warning: {item} has no id and cannot participate in narration timing",+ file=sys.stderr,+ )++ targets_by_id = {target.group_id: target for target in targets}+ referenced_ids = set(groups_cfg)+ if plan_entries is not None:+ referenced_ids.update(entry.group_id for entry in plan_entries)+ missing_ids = sorted(referenced_ids - set(targets_by_id))+ if missing_ids:+ raise ValueError(+ f'Animation mapping for slide "{slide_name}" references missing '+ f"top-level group(s): {', '.join(missing_ids)}"+ )+ structural_ids = sorted(+ group_id+ for group_id in referenced_ids+ if targets_by_id[group_id].structurally_static+ and (+ group_id not in groups_cfg+ or _group_is_animated(groups_cfg[group_id], settings.effect)+ )+ )+ if structural_ids:+ raise ValueError(+ f'Animation mapping for slide "{slide_name}" targets structural '+ f"group(s): {', '.join(structural_ids)}"+ )++ candidate_ids = []+ for target in targets:+ if target.structurally_static:+ continue+ group_cfg = groups_cfg.get(target.group_id, {})+ explicitly_animated = (+ target.group_id in groups_cfg+ and _group_is_animated(group_cfg, settings.effect)+ )+ if target.chrome and not explicitly_animated:+ continue+ candidate_ids.append(target.group_id)+ elif plan_entries is not None:+ candidate_ids = list(+ dict.fromkeys(+ [+ *(entry.group_id for entry in plan_entries),+ *groups_cfg,+ ]+ )+ )+ else:+ candidate_ids = list(groups_cfg)++ preliminaries: list[tuple[int, int, str, dict[str, Any]]] = []+ for source_index, group_id in enumerate(candidate_ids):+ group_cfg = groups_cfg.get(group_id, {})+ if not _group_is_animated(group_cfg, settings.effect):continue- rhythms[int(match.group("page"))] = match.group("rhythm")- return rhythms---def _profile_for_slide(- slide_index: int,- slide_count: int,- rhythms: dict[int, str],-) -> dict[str, float]:- profile = dict(_RHYTHM_PROFILES.get(rhythms.get(slide_index), _DEFAULT_PROFILE))- if slide_index == 1:- profile["transition_duration"] = 0.6- profile["animation_duration"] = max(profile["animation_duration"], 0.55)- profile["stagger"] = max(profile["stagger"], 0.3)- if slide_index == slide_count:- profile["transition_duration"] = 0.6- profile["animation_duration"] = max(profile["animation_duration"], 0.65)- profile["stagger"] = max(profile["stagger"], 0.35)- return profile+ order = group_cfg.get("order", source_index + 1)+ if isinstance(order, bool) or not isinstance(order, int) or order <= 0:+ raise ValueError(+ f'Canonical animation order for "{slide_name}/{group_id}" '+ f"must be a positive integer: {order!r}"+ )+ preliminaries.append((order, source_index, group_id, group_cfg))+ preliminaries.sort(key=lambda item: (item[0], item[1]))++ states: list[AnimationGroupState] = []+ for sequence_index, (order, source_index, group_id, group_cfg) in enumerate(+ preliminaries+ ):+ duration_ms = animation_seconds_to_milliseconds(+ group_cfg.get("duration", settings.duration_ms / 1000),+ f'canonical animation duration for "{slide_name}/{group_id}"',+ allow_zero=False,+ )+ original_delay_ms = animation_seconds_to_milliseconds(+ group_cfg.get(+ "delay",+ 0 if sequence_index == 0 else settings.stagger_ms / 1000,+ ),+ f'canonical animation delay for "{slide_name}/{group_id}"',+ allow_zero=True,+ )+ states.append(+ AnimationGroupState(+ group_id=group_id,+ order=order,+ source_index=source_index,+ duration_ms=duration_ms,+ original_delay_ms=original_delay_ms,+ )+ )+ return states, use_svgdef _find_audio(audio_dir: Path, slide_name: str) -> Path:@@ -431,98 +755,75 @@ def _seconds_from_ms(value: int) -> float:def rebuild_animations(project_path: Path,*,+ canonical_path: Path,plan_path: Path,subtitle_dir: Path,audio_dir: Path,output_path: Path,narration_padding: float,force: bool,-) -> tuple[int, int, int, int]:- """Replace ``animations.json`` from the current SVG/SRT timing plan."""+) -> AnimationBuildResult:+ """Derive narration timing without modifying the canonical animation file."""if not math.isfinite(narration_padding) or narration_padding < 0:raise ValueError("Narration padding must be finite and non-negative")_reject_output_alias(output_path,- [plan_path],- label="Animation config",+ [canonical_path, plan_path],+ label="Narration animation config",)-- targets_by_slide, anonymous_groups = scan_project_targets(project_path)- if anonymous_groups:- details = "\n".join(f"- {item}" for item in anonymous_groups)- raise ValueError(- "Every top-level animation group must have an id before narration sync:\n"- f"{details}"- )- slide_names = list(targets_by_slide)- if not slide_names:- raise ValueError(f"No SVG slides found under: {project_path / 'svg_output'}")-- for slide_name, targets in targets_by_slide.items():- group_ids = [target.group_id for target in targets]- duplicate_ids = sorted(- group_id- for group_id in set(group_ids)- if group_ids.count(group_id) > 1- )- if duplicate_ids:- raise ValueError(- f'SVG slide "{slide_name}" has duplicate top-level group id(s): '- f"{', '.join(duplicate_ids)}"- )-- (- expected_srt_sha256,- planned_narration_padding,- timing_plan,- ) = _load_timing_plan(plan_path)- if not math.isclose(- narration_padding,- planned_narration_padding,- rel_tol=0,- abs_tol=1e-9,- ):- raise ValueError(- "Narration padding differs from the timing plan: "- f"plan={planned_narration_padding}, command={narration_padding}"- )- subtitle_paths = [- subtitle_dir / f"{slide_name}.srt"- for slide_name in slide_names- ]+ canonical = _load_canonical_animation_config(canonical_path)+ slide_names = _animation_slide_names(project_path, canonical, subtitle_dir)+ subtitle_paths = [subtitle_dir / f"{slide_name}.srt" for slide_name in slide_names]_reject_output_alias(output_path,subtitle_paths,- label="Animation config",+ label="Narration animation config",)- current_srt_sha256 = _subtitle_fingerprint(slide_names, subtitle_dir)- if current_srt_sha256 != expected_srt_sha256:- raise ValueError(- "Narration timing plan was authored for a different SRT set: "- f"plan={expected_srt_sha256}, current={current_srt_sha256}; "- "rebuild the cue mapping before regenerating animations"++ timing_plan: dict[str, list[TimingPlanEntry]] | None = None+ if plan_path.is_file():+ expected_srt_sha256, planned_padding, loaded_plan = _load_timing_plan(+ plan_path)+ if not math.isclose(+ narration_padding,+ planned_padding,+ rel_tol=0,+ abs_tol=1e-9,+ ):+ raise ValueError(+ "Narration padding differs from the timing plan: "+ f"plan={planned_padding}, command={narration_padding}"+ )+ current_srt_sha256 = _subtitle_fingerprint(slide_names, subtitle_dir)+ if current_srt_sha256 != expected_srt_sha256:+ raise ValueError(+ "Narration timing plan was authored for a different SRT set: "+ f"plan={expected_srt_sha256}, current={current_srt_sha256}"+ )+ if set(loaded_plan) != set(slide_names):+ raise ValueError(+ "Narration timing plan slides do not match animations.json"+ )+ timing_plan = loaded_plan++ derived = copy.deepcopy(canonical)+ canonical_slides = canonical.get("slides", {})+ derived_slides = derived.setdefault("slides", {})+ if not isinstance(canonical_slides, dict) or not isinstance(+ derived_slides,+ dict,+ ):+ raise ValueError('Canonical animations.json field "slides" must be an object')- expected_slides = set(slide_names)- planned_slides = set(timing_plan)- if expected_slides != planned_slides:- missing = sorted(expected_slides - planned_slides)- extra = sorted(planned_slides - expected_slides)- details = []- if missing:- details.append(f"missing slide(s): {', '.join(missing)}")- if extra:- details.append(f"unknown slide(s): {', '.join(extra)}")- raise ValueError("Narration timing plan does not match current SVGs: " + "; ".join(details))-- rhythms = _load_page_rhythms(project_path / "spec_lock.md")- slides_config: dict[str, Any] = {}anchored_count = 0fallback_count = 0+ ignored_cue_count = 0+ svg_fallback_slide_count = 0drift_warnings: list[str] = []audio_paths: list[Path] = []- for slide_index, slide_name in enumerate(slide_names, 1):+ for slide_name in slide_names:cues = _parse_srt(subtitle_dir / f"{slide_name}.srt")audio_path = _find_audio(audio_dir, slide_name)audio_paths.append(audio_path)@@ -532,86 +833,99 @@ def rebuild_animations(f"Unable to read narration duration with ffprobe: {audio_path}")- all_targets = {target.group_id: target for target in targets_by_slide[slide_name]}- required_groups = {- target.group_id- for target in targets_by_slide[slide_name]- if not target.chrome- }- entries = timing_plan[slide_name]- planned_groups = {entry.group_id for entry in entries}- missing_groups = sorted(required_groups - planned_groups)- if missing_groups:+ canonical_slide = canonical_slides.get(slide_name, {})+ if not isinstance(canonical_slide, dict):+ raise ValueError(+ f'Canonical animations.json slide "{slide_name}" must be an object'+ )+ derived_slide = derived_slides.setdefault(+ slide_name,+ copy.deepcopy(canonical_slide),+ )+ if not isinstance(derived_slide, dict):raise ValueError(- f'Narration timing plan slide "{slide_name}" omits content group(s): '- f"{', '.join(missing_groups)}"+ f'Derived animation slide "{slide_name}" must be an object')+ settings = _effective_slide_animation(canonical, canonical_slide)+ plan_entries = timing_plan.get(slide_name) if timing_plan else None+ states, used_svg = _resolve_animation_groups(+ project_path,+ slide_name,+ canonical_slide,+ settings,+ plan_entries,+ )+ if used_svg:+ svg_fallback_slide_count += 1++ state_ids = {state.group_id for state in states}+ cue_by_group: dict[str, int | None] = {}+ if plan_entries is not None:+ for entry in plan_entries:+ if entry.group_id not in state_ids:+ raise ValueError(+ f'Narration timing plan references a non-animated group: '+ f"{slide_name}/{entry.group_id}"+ )+ if entry.cue_number is not None and entry.cue_number > len(cues):+ raise ValueError(+ f'Narration timing plan "{slide_name}/{entry.group_id}" '+ f"references cue {entry.cue_number}, but the SRT has "+ f"{len(cues)} cues"+ )+ cue_by_group[entry.group_id] = entry.cue_number+ else:+ cue_by_group = {+ state.group_id: index + 1 if index < len(cues) else None+ for index, state in enumerate(states)+ }- for entry in entries:- target = all_targets.get(entry.group_id)- if target is None:- raise ValueError(- f'Narration timing plan references missing group: '- f"{slide_name}/{entry.group_id}"- )- if target.structurally_static:- raise ValueError(- f"Narration timing plan cannot animate structural group: "- f"{slide_name}/{entry.group_id}"- )- if entry.cue_number is not None and entry.cue_number > len(cues):- raise ValueError(- f'Narration timing plan "{slide_name}/{entry.group_id}" '- f"references cue {entry.cue_number}, but the SRT has {len(cues)} cues"- )+ animation_value = derived_slide.setdefault("animation", {})+ if not isinstance(animation_value, dict):+ raise ValueError(+ f'Derived animation slide "{slide_name}" animation must be an object'+ )+ animation_value["trigger"] = "after-previous"+ groups_value = derived_slide.setdefault("groups", {})+ if not isinstance(groups_value, dict):+ raise ValueError(+ f'Derived animation slide "{slide_name}" groups must be an object'+ )- profile = _profile_for_slide(slide_index, len(slide_names), rhythms)- animation_duration_ms = int(profile["animation_duration"] * 1000)- stagger_ms = int(profile["stagger"] * 1000)previous_end_ms = 0- groups_config: dict[str, Any] = {}-- for order, entry in enumerate(entries, 1):- next_entry = entries[order] if order < len(entries) else None- effective_duration_ms = animation_duration_ms- if (- entry.cue_number is not None- and next_entry is not None- and next_entry.cue_number == entry.cue_number- ):- effective_duration_ms = min(animation_duration_ms, 250)-- if entry.cue_number is None:+ referenced_cues: set[int] = set()+ for state in states:+ cue_number = cue_by_group.get(state.group_id)+ if cue_number is None:fallback_count += 1- if order == 1:- desired_start_ms = cues[0].start_ms- actual_start_ms = max(desired_start_ms, previous_end_ms)- delay_ms = actual_start_ms - previous_end_ms- else:- delay_ms = stagger_ms- actual_start_ms = previous_end_ms + delay_ms+ delay_ms = state.original_delay_ms+ actual_start_ms = previous_end_ms + delay_mselse:anchored_count += 1- desired_start_ms = cues[entry.cue_number - 1].start_ms+ referenced_cues.add(cue_number)+ desired_start_ms = cues[cue_number - 1].start_msactual_start_ms = max(desired_start_ms, previous_end_ms)delay_ms = actual_start_ms - previous_end_msdrift_ms = actual_start_ms - desired_start_msif drift_ms > 500:drift_warnings.append(- f"{slide_name}/{entry.group_id}: cue {entry.cue_number} "+ f"{slide_name}/{state.group_id}: cue {cue_number} "f"starts at {_seconds_from_ms(desired_start_ms):.3f}s, "f"animation starts at {_seconds_from_ms(actual_start_ms):.3f}s "f"(after-previous drift {_seconds_from_ms(drift_ms):.3f}s)")- group_config = {- "order": order,- "delay": _seconds_from_ms(delay_ms),- }- if effective_duration_ms != animation_duration_ms:- group_config["duration"] = _seconds_from_ms(effective_duration_ms)- groups_config[entry.group_id] = group_config- previous_end_ms = actual_start_ms + effective_duration_ms+ group_value = groups_value.setdefault(state.group_id, {})+ if not isinstance(group_value, dict):+ raise ValueError(+ f'Derived animation group "{slide_name}/{state.group_id}" '+ "must be an object"+ )+ group_value["order"] = state.order+ group_value["delay"] = _seconds_from_ms(delay_ms)+ previous_end_ms = actual_start_ms + state.duration_ms++ ignored_cue_count += len(cues) - len(referenced_cues)advance_ms = int((audio_duration + narration_padding) * 1000)if previous_end_ms > advance_ms:@@ -621,47 +935,39 @@ def rebuild_animations(f"slide advance at {_seconds_from_ms(advance_ms):.3f}s")- slides_config[slide_name] = {- "transition": {- "effect": "fade",- "duration": profile["transition_duration"],- },- "animation": {- "effect": "auto",- "duration": profile["animation_duration"],- "stagger": profile["stagger"],- "trigger": "after-previous",- },- "groups": groups_config,- }-_reject_output_alias(output_path,audio_paths,- label="Animation config",+ label="Narration animation config",)_require_replaceable(output_path, force)- config = {- "version": 1,- "defaults": {- "transition": {"effect": "fade", "duration": 0.4},- "animation": {- "effect": "auto",- "duration": 0.4,- "stagger": 0.25,- "trigger": "after-previous",- },- },- "slides": slides_config,- }+ derived_errors = list(+ dict.fromkeys(+ [+ *validate_transition_config(derived),+ *validate_animation_config_errors(derived),+ ]+ )+ )+ if derived_errors:+ details = "\n".join(f"- {error}" for error in derived_errors)+ raise ValueError(f"Derived narration animation config is invalid:\n{details}")_atomic_write_text(output_path,- json.dumps(config, ensure_ascii=False, indent=2) + "\n",+ json.dumps(derived, ensure_ascii=False, indent=2) + "\n",)for warning in drift_warnings:print(f"Warning: {warning}", file=sys.stderr)- return len(slide_names), anchored_count + fallback_count, anchored_count, fallback_count+ return AnimationBuildResult(+ slide_count=len(slide_names),+ group_count=anchored_count + fallback_count,+ anchored_count=anchored_count,+ fallback_count=fallback_count,+ ignored_cue_count=ignored_cue_count,+ svg_fallback_slide_count=svg_fallback_slide_count,+ timing_plan_written=False,+ )def _presentation_slide_members(package: zipfile.ZipFile) -> list[str]:@@ -1140,7 +1446,7 @@ def merge_subtitles_to_video(def build_parser() -> argparse.ArgumentParser:parser = argparse.ArgumentParser(description=(- "Rebuild narrated object animation timings and merge page-local "+ "Derive narrated object animation timings and merge page-local ""SRT files on PowerPoint's final timeline."),formatter_class=argparse.RawDescriptionHelpFormatter,@@ -1160,9 +1466,14 @@ def build_parser() -> argparse.ArgumentParser:animations = subparsers.add_parser("animations",- help="replace animations.json from narration_timing.json and page-local SRT",+ help="derive narration_animations.json from animations.json and page-local SRT",)animations.add_argument("project_path", help="Project directory")+ animations.add_argument(+ "--animation-config",+ default=None,+ help="Read-only canonical config; default: <project>/animations.json",+ )animations.add_argument("--plan",default=None,@@ -1182,7 +1493,10 @@ def build_parser() -> argparse.ArgumentParser:"-o","--output",default=None,- help="Animation config output; default: <project>/animations.json",+ help=(+ "Narration animation output; "+ "default: <project>/narration_animations.json"+ ),)animations.add_argument("--narration-padding",@@ -1193,7 +1507,7 @@ def build_parser() -> argparse.ArgumentParser:animations.add_argument("--force",action="store_true",- help="Replace an existing animations.json",+ help="Replace an existing narration_animations.json",)subtitles = subparsers.add_parser(@@ -1258,18 +1572,18 @@ def main(argv: list[str] | None = None) -> int:args.subtitle_dir,Path("notes/subtitles"),)- targets_by_slide, _anonymous_groups = scan_project_targets(project_path)- slide_names = list(targets_by_slide)- if not slide_names:- raise ValueError(- f"No SVG slides found under: {project_path / 'svg_output'}"- )+ slide_names = _page_subtitle_names(subtitle_dir)for slide_name in slide_names:_parse_srt(subtitle_dir / f"{slide_name}.srt")print(_subtitle_fingerprint(slide_names, subtitle_dir))return 0if args.command == "animations":+ canonical_path = _project_path(+ project_path,+ args.animation_config,+ Path("animations.json"),+ )plan_path = _project_path(project_path,args.plan,@@ -1288,10 +1602,11 @@ def main(argv: list[str] | None = None) -> int:output_path = _project_path(project_path,args.output,- Path("animations.json"),+ Path("narration_animations.json"),)- slide_count, group_count, anchored_count, fallback_count = rebuild_animations(+ result = rebuild_animations(project_path,+ canonical_path=canonical_path,plan_path=plan_path,subtitle_dir=subtitle_dir,audio_dir=audio_dir,@@ -1299,10 +1614,13 @@ def main(argv: list[str] | None = None) -> int:narration_padding=args.narration_padding,force=args.force,)- print(f"Animation config rebuilt: {output_path}")+ print(f"Narration animation config written: {output_path}")print(- f"Slides: {slide_count}; groups: {group_count}; "- f"SRT-anchored: {anchored_count}; sequential fallback: {fallback_count}"+ f"Slides: {result.slide_count}; groups: {result.group_count}; "+ f"SRT-anchored: {result.anchored_count}; "+ f"canonical-delay fallback: {result.fallback_count}; "+ f"SVG fallback slides: {result.svg_fallback_slide_count}; "+ f"unused cues: {result.ignored_cue_count}")return 0diff --git a/skills/ppt-master/scripts/notes_to_audio.py b/skills/ppt-master/scripts/notes_to_audio.pyindex f0bc1aa5..e119aad9 100644--- a/skills/ppt-master/scripts/notes_to_audio.py+++ b/skills/ppt-master/scripts/notes_to_audio.py@@ -3,7 +3,7 @@This script uses provider backends for the same per-slide output contract onmacOS, Linux, and Windows. `edge-tts` remains the default no-key backend and-also writes one compact, word-timed SRT file per slide from the same TTS stream.+also writes one sentence-timed SRT file per slide from the same TTS stream.Usage:python3 skills/ppt-master/scripts/notes_to_audio.py <project_path> --voice zh-CN-XiaoxiaoNeural@@ -112,7 +112,10 @@ def main() -> int:"--subtitle-max-chars",type=int,default=backend_edge.DEFAULT_SUBTITLE_MAX_CHARS,- help="maximum visible characters per Edge subtitle cue (default: 20)",+ help=(+ "deprecated compatibility option; ignored because Edge SentenceBoundary "+ "cues are preserved unchanged"+ ),)parser.add_argument("--elevenlabs-api-key-env",@@ -252,10 +255,6 @@ def main() -> int:parser.error(f"--voice-id is required for --provider {args.provider}")raise AssertionError("unreachable")- if args.subtitle_max_chars < 1:- parser.error("--subtitle-max-chars must be at least 1")- raise AssertionError("unreachable")-if args.provider == "elevenlabs":if not voice_id:parser.error("--voice-id is required for --provider elevenlabs")diff --git a/skills/ppt-master/scripts/svg_to_pptx/pptx_package/cli.py b/skills/ppt-master/scripts/svg_to_pptx/pptx_package/cli.pyindex 358f02dd..b3da5a76 100644--- a/skills/ppt-master/scripts/svg_to_pptx/pptx_package/cli.py+++ b/skills/ppt-master/scripts/svg_to_pptx/pptx_package/cli.py@@ -689,6 +689,9 @@ Recorded narration:- Keeps speaker notes when enabled- Prepares PowerPoint recorded timings and narrations- Requires one m4a/mp3/wav file per slide+ - Uses narration_animations.json by default+ - Use --animation-config animations.json for the canonical animation+ - Use --no-animations for narration and timings without animation motion- Embeds per-slide audio matched by SVG filename / slide number- Sets slide auto-advance from audio duration so video export can use"recorded timings and narrations"@@ -819,9 +822,25 @@ Recorded narration:parser.add_argument('--animation-stagger', type=non_negative_float, default=None,help='Delay between elements in --animation-trigger=after-previous ''(seconds, default 0.5). Ignored in other modes.')- parser.add_argument('--animation-config', type=str, default=None,- help='Optional per-slide/per-object animation config. '- 'Default: <project>/animations.json when present.')+ animation_source = parser.add_mutually_exclusive_group()+ animation_source.add_argument(+ '--animation-config',+ type=str,+ default=None,+ help=(+ 'Per-slide/per-object animation config. Recorded narration defaults '+ 'to <project>/narration_animations.json; other exports default to '+ '<project>/animations.json when present.'+ ),+ )+ animation_source.add_argument(+ '--no-animations',+ action='store_true',+ help=(+ 'Export without object animations or page-transition motion. '+ 'Narration audio and slide advance timings are preserved.'+ ),+ )parser.add_argument('--no-notes', action='store_true',help='Disable speaker notes embedding (enabled by default)')@@ -1147,18 +1166,65 @@ Recorded narration:"unmatched slides will export without audio.")- if args.animation_config:- config_path = Path(args.animation_config)+ if args.no_animations and any(+ value is not None+ for value in (+ args.transition,+ args.transition_duration,+ args.animation,+ args.animation_duration,+ args.animation_trigger,+ args.animation_stagger,+ )+ ):+ print(+ "Error: --no-animations cannot be combined with transition or "+ "object-animation overrides.",+ file=sys.stderr,+ )+ return 1++ effective_animation_config = args.animation_config+ if (+ effective_animation_config is None+ and args.recorded_narration+ and not args.no_animations+ ):+ effective_animation_config = 'narration_animations.json'++ if effective_animation_config:+ config_path = Path(effective_animation_config)if not config_path.is_absolute():config_path = project_path / config_pathif not config_path.exists():- print(f"Error: Animation config does not exist: {config_path}")+ print(+ f"Error: Animation config does not exist: {config_path}",+ file=sys.stderr,+ )+ if (+ args.recorded_narration+ and args.animation_config is None+ and config_path.name == 'narration_animations.json'+ ):+ print(+ "Generate it with narration_sync.py animations, select the "+ "canonical config with --animation-config animations.json, "+ "or disable animations with --no-animations.",+ file=sys.stderr,+ )return 1try:- animation_config = load_animation_config(project_path, args.animation_config)+ animation_config = (+ None+ if args.no_animations+ else load_animation_config(+ project_path,+ effective_animation_config,+ )+ )except Exception as exc:- print(f"Error: Failed to load animation config: {exc}")+ print(f"Error: Failed to load animation config: {exc}", file=sys.stderr)return 1config_errors: list[str] = []if animation_config:@@ -1187,10 +1253,15 @@ Recorded narration:return 1if animation_config and verbose:- config_label = args.animation_config or str(project_path / 'animations.json')+ config_label = (+ effective_animation_config+ or str(project_path / 'animations.json')+ )print(f" Animation config: {config_label}")for warning in config_warnings:print(f" [warn] {warning}")+ elif args.no_animations and verbose:+ print(" Animations: disabled")defaults = animation_config.get('defaults', {}) if animation_config else {}transition_defaults = _as_dict(defaults.get('transition')) if isinstance(defaults, dict) else {}@@ -1198,9 +1269,13 @@ Recorded narration:transition_arg = args.transitiontransition_effect = (- transition_arg- if transition_arg is not None- else transition_defaults.get('effect', 'fade')+ 'none'+ if args.no_animations+ else (+ transition_arg+ if transition_arg is not None+ else transition_defaults.get('effect', 'fade')+ ))transition = None if transition_effect == 'none' else transition_effecttry:@@ -1230,12 +1305,16 @@ Recorded narration:try:animation_effect = (- args.animation- if args.animation is not None- # Per-element entrance is opt-in by default: auto-firing element builds- # read as the "AI deck" tell and were unsolicited. Page transitions stay- # on (see transition default above). Re-enable with -a auto / animations.json.- else animation_defaults.get('effect', 'none')+ 'none'+ if args.no_animations+ else (+ args.animation+ if args.animation is not None+ # Per-element entrance is opt-in by default: auto-firing element builds+ # read as the "AI deck" tell and were unsolicited. Page transitions stay+ # on (see transition default above). Re-enable with -a auto / animations.json.+ else animation_defaults.get('effect', 'none')+ ))animation = normalize_animation_effect(animation_effect)animation_duration = validate_seconds(diff --git a/skills/ppt-master/scripts/tts_backends/backend_edge.py b/skills/ppt-master/scripts/tts_backends/backend_edge.pyindex bc0a2ae7..1f7e0a98 100644--- a/skills/ppt-master/scripts/tts_backends/backend_edge.py+++ b/skills/ppt-master/scripts/tts_backends/backend_edge.py@@ -9,18 +9,9 @@ from dataclasses import dataclassfrom pathlib import Path+# Kept for CLI compatibility. Edge sentence boundaries are no longer split by+# a local character limit.DEFAULT_SUBTITLE_MAX_CHARS = 20-_SENTENCE_END = frozenset("。!?!?")-_CLAUSE_END = frozenset(",,;;::")-_CLOSING_PUNCTUATION = frozenset('”’」』)》)"\'')---@dataclass(frozen=True)-class _MappedWord:- start: int- end: int- source_start: int- source_end: int@dataclass(frozen=True)@@ -76,15 +67,15 @@ async def generate(subtitle_path: Path | None = None,subtitle_max_chars: int = DEFAULT_SUBTITLE_MAX_CHARS,) -> None:- """Generate narration audio and, when requested, its compact SRT."""+ """Generate narration audio and, when requested, its sentence-timed SRT."""if subtitle_path is not None:+ _ = subtitle_max_chars # Deprecated compatibility option; intentionally ignored.await _generate_with_subtitles(text,output_path,subtitle_path,voice=voice,rate=rate,- max_chars=subtitle_max_chars,)return@@ -152,224 +143,40 @@ def _publish_pair(backup.unlink(missing_ok=True)-def _text_key(text: str) -> str:- return "".join(character.casefold() for character in text if character.isalnum())---def _source_key_positions(text: str) -> tuple[str, list[int]]:- key: list[str] = []- positions: list[int] = []- for index, character in enumerate(text):- if not character.isalnum():- continue- normalized = character.casefold()- key.extend(normalized)- positions.extend([index] * len(normalized))- return "".join(key), positions+def _sentence_cues(text: str, boundaries: list[dict]) -> list[_SubtitleCue]:+ """Validate Edge sentence boundaries without re-segmenting them."""+ if not boundaries:+ raise RuntimeError("Edge TTS produced no sentence-boundary timing")--def _map_word_boundaries(text: str, boundaries: list[dict]) -> list[_MappedWord]:- source_key, source_positions = _source_key_positions(text)- boundary_keys = [_text_key(boundary["text"]) for boundary in boundaries]- boundary_key = "".join(boundary_keys)- if not source_key or source_key != boundary_key:- raise RuntimeError(- "Edge TTS word boundaries could not be aligned with the narration text; "- "subtitle timing was not generated"- )-- mapped: list[_MappedWord] = []- key_offset = 0- for boundary, word_key in zip(boundaries, boundary_keys):- if not word_key:- continue- key_end = key_offset + len(word_key)- mapped.append(- _MappedWord(- start=boundary["offset"],- end=boundary["offset"] + boundary["duration"],- source_start=source_positions[key_offset],- source_end=source_positions[key_end - 1] + 1,+ cues: list[_SubtitleCue] = []+ for boundary in boundaries:+ cue_text = re.sub(r"\s+", " ", str(boundary.get("text", ""))).strip()+ try:+ start = int(boundary["offset"])+ duration = int(boundary["duration"])+ except (KeyError, TypeError, ValueError) as exc:+ raise RuntimeError(+ "Edge TTS returned an invalid sentence-boundary payload; "+ "audio and subtitles were not published"+ ) from exc++ if not cue_text or start < 0 or duration <= 0:+ raise RuntimeError(+ "Edge TTS returned an invalid subtitle timing interval; "+ "audio and subtitles were not published")- )- key_offset = key_end- return mapped---def _trim_span(text: str, start: int, end: int) -> tuple[int, int]:- while start < end and text[start].isspace():- start += 1- while end > start and text[end - 1].isspace():- end -= 1- return start, end---def _display_length(text: str, start: int, end: int) -> int:- return sum(not character.isspace() for character in text[start:end])---def _is_sentence_end(text: str, index: int) -> bool:- character = text[index]- if character in _SENTENCE_END:- return True- if character != ".":- return False- previous = text[index - 1] if index else ""- following = text[index + 1] if index + 1 < len(text) else ""- return not (previous.isdigit() and following.isdigit())---def _sentence_spans(text: str) -> list[tuple[int, int]]:- spans: list[tuple[int, int]] = []- start = 0- index = 0- while index < len(text):- if not _is_sentence_end(text, index):- index += 1- continue- end = index + 1- while end < len(text) and text[end] in _CLOSING_PUNCTUATION:- end += 1- span = _trim_span(text, start, end)- if span[0] < span[1]:- spans.append(span)- start = end- index = end- span = _trim_span(text, start, len(text))- if span[0] < span[1]:- spans.append(span)- return spans---def _hard_split_span(- text: str,- span: tuple[int, int],- words: list[_MappedWord],- max_chars: int,-) -> list[tuple[int, int]]:- start, end = span- parts: list[tuple[int, int]] = []- while _display_length(text, start, end) > max_chars:- remaining_length = _display_length(text, start, end)- remaining_parts = (remaining_length + max_chars - 1) // max_chars- target_length = (remaining_length + remaining_parts - 1) // remaining_parts- candidates = [- (word.source_end, _display_length(text, start, word.source_end))- for word in words- if start < word.source_end < end- and _display_length(text, start, word.source_end) <= max_chars- ]- if candidates:- split_at, _ = min(- candidates,- key=lambda candidate: (- abs(candidate[1] - target_length),- -candidate[1],- ),+ if cues and start < cues[-1].end:+ raise RuntimeError(+ "Edge TTS returned overlapping sentence-boundary timing; "+ "audio and subtitles were not published")- else:- split_at = next(- (- word.source_end- for word in words- if start < word.source_end < end- ),- end,+ cues.append(+ _SubtitleCue(+ start=start,+ end=start + duration,+ text=cue_text,)- if split_at >= end:- break- part = _trim_span(text, start, split_at)- if part[0] < part[1]:- parts.append(part)- start = split_at- part = _trim_span(text, start, end)- if part[0] < part[1]:- parts.append(part)- return parts---def _split_sentence_span(- text: str,- sentence: tuple[int, int],- words: list[_MappedWord],- max_chars: int,-) -> list[tuple[int, int]]:- if _display_length(text, *sentence) <= max_chars:- return [sentence]-- start, end = sentence- clauses: list[tuple[int, int]] = []- clause_start = start- for index in range(start, end):- if text[index] not in _CLAUSE_END:- continue- clause = _trim_span(text, clause_start, index + 1)- if clause[0] < clause[1]:- clauses.append(clause)- clause_start = index + 1- clause = _trim_span(text, clause_start, end)- if clause[0] < clause[1]:- clauses.append(clause)-- atoms = [- part- for clause in clauses- for part in _hard_split_span(text, clause, words, max_chars)- ]- merged: list[tuple[int, int]] = []- for atom in atoms:- if not merged:- merged.append(atom)- continue- candidate = (merged[-1][0], atom[1])- if _display_length(text, *candidate) <= max_chars:- merged[-1] = candidate- else:- merged.append(atom)- return merged---def _subtitle_cues(- text: str,- boundaries: list[dict],- max_chars: int,-) -> list[_SubtitleCue]:- if max_chars < 1:- raise ValueError("subtitle_max_chars must be at least 1")- words = _map_word_boundaries(text, boundaries)- spans = [- span- for sentence in _sentence_spans(text)- for span in _split_sentence_span(text, sentence, words, max_chars)- ]-- pending: list[tuple[int, int, str]] = []- assigned_word_indexes: list[int] = []- for start, end in spans:- matching = [- (index, word)- for index, word in enumerate(words)- if word.source_start >= start and word.source_end <= end- ]- if not matching:- continue- cue_text = re.sub(r"\s+", " ", text[start:end]).strip()- assigned_word_indexes.extend(index for index, _ in matching)- pending.append((matching[0][1].start, matching[-1][1].end, cue_text))-- if assigned_word_indexes != list(range(len(words))):- raise RuntimeError(- "Edge TTS word boundaries crossed subtitle split points; "- "subtitle timing was not generated")- if not pending:- raise RuntimeError("Edge TTS produced no timed subtitle cues")-- cues: list[_SubtitleCue] = []- for index, (start, word_end, cue_text) in enumerate(pending):- next_start = pending[index + 1][0] if index + 1 < len(pending) else None- end = next_start if next_start is not None and next_start > word_end else word_end- cues.append(_SubtitleCue(start=start, end=end, text=cue_text))source_text = re.sub(r"\s+", "", text)subtitle_text = re.sub(r"\s+", "", "".join(cue.text for cue in cues))@@ -378,16 +185,6 @@ def _subtitle_cues("Generated subtitle text does not match the narration text; ""audio and subtitles were not published")- if any(_display_length(cue.text, 0, len(cue.text)) > max_chars for cue in cues):- raise RuntimeError(- "A single Edge TTS word boundary exceeds the subtitle character limit; "- "audio and subtitles were not published"- )- if any(cue.end <= cue.start for cue in cues):- raise RuntimeError(- "Edge TTS returned an invalid subtitle timing interval; "- "audio and subtitles were not published"- )return cues@@ -418,9 +215,8 @@ async def _generate_with_subtitles(*,voice: str,rate: str,- max_chars: int,) -> None:- """Generate one MP3 and compact SRT from the same Edge word-timing stream."""+ """Generate one MP3 and sentence-timed SRT from the same Edge stream."""try:import edge_ttsexcept ImportError as exc:@@ -433,7 +229,7 @@ async def _generate_with_subtitles(text,voice=voice,rate=normalize_rate(rate),- boundary="WordBoundary",+ boundary="SentenceBoundary",)audio_descriptor = -1subtitle_descriptor = -1@@ -452,7 +248,7 @@ async def _generate_with_subtitles(if chunk["type"] == "audio":audio_stream.write(chunk["data"])received_audio = True- elif chunk["type"] == "WordBoundary":+ elif chunk["type"] == "SentenceBoundary":boundaries.append(chunk)audio_stream.flush()os.fsync(audio_stream.fileno())@@ -460,8 +256,8 @@ async def _generate_with_subtitles(if not received_audio:raise RuntimeError("Edge TTS returned no audio data")if not boundaries:- raise RuntimeError("Edge TTS returned no word-boundary timing")- subtitle_text = _format_srt(_subtitle_cues(text, boundaries, max_chars))+ raise RuntimeError("Edge TTS returned no sentence-boundary timing")+ subtitle_text = _format_srt(_sentence_cues(text, boundaries))subtitle_stream = os.fdopen(subtitle_descriptor,diff --git a/skills/ppt-master/scripts/video_subtitles.py b/skills/ppt-master/scripts/video_subtitles.pynew file mode 100644index 00000000..1335f75d--- /dev/null+++ b/skills/ppt-master/scripts/video_subtitles.py@@ -0,0 +1,403 @@+#!/usr/bin/env python3+"""+PPT Master - Final Video Subtitles++Align the exact narration text frozen in page-local Edge SRT files against the+audio track of a finished PowerPoint-exported video. This produces a delivery+SRT from the actual video timeline without rewriting speaker notes or relying+on theoretical slide offsets.++Usage:+ python3 scripts/video_subtitles.py <project_path> --video <video> --language <language>++Examples:+ python3 scripts/video_subtitles.py projects/demo --video exports/demo.mp4 --language zh --force++Dependencies:+ ffmpeg+ python3 -m pip install stable-ts+"""++from __future__ import annotations++import argparse+import os+import re+import shutil+import sys+import tempfile+from dataclasses import dataclass+from pathlib import Path+from typing import Any++from console_encoding import configure_utf8_stdio++configure_utf8_stdio()+++DEFAULT_MAX_CHARS = 20+_TIMING_RE = re.compile(+ r"^(?P<start>\d+:\d{2}:\d{2},\d{3})\s+-->\s+"+ r"(?P<end>\d+:\d{2}:\d{2},\d{3})(?:\s+.*)?$"+)+_CLAUSE_END = frozenset(",,;;::")+++@dataclass(frozen=True)+class SubtitleCue:+ """One validated SRT cue."""++ start_ms: int+ end_ms: int+ text: str+++def _timestamp_to_ms(value: str) -> int:+ hours_text, minutes_text, remainder = value.split(":")+ seconds_text, milliseconds_text = remainder.split(",")+ hours = int(hours_text)+ minutes = int(minutes_text)+ seconds = int(seconds_text)+ milliseconds = int(milliseconds_text)+ if minutes >= 60 or seconds >= 60:+ raise ValueError(f"Invalid SRT timestamp: {value}")+ return (((hours * 60) + minutes) * 60 + seconds) * 1000 + milliseconds+++def _parse_srt(path: Path) -> list[SubtitleCue]:+ """Read one strict, non-overlapping SRT file."""+ text = path.read_text(encoding="utf-8-sig")+ blocks = re.split(r"\r?\n\s*\r?\n", text.strip())+ cues: list[SubtitleCue] = []+ previous_end = -1++ for block_number, block in enumerate(blocks, 1):+ lines = block.splitlines()+ if len(lines) < 3:+ raise ValueError(f"{path}: malformed SRT block {block_number}")+ try:+ cue_number = int(lines[0].strip())+ except ValueError as exc:+ raise ValueError(+ f"{path}: invalid cue number in block {block_number}"+ ) from exc+ if cue_number != block_number:+ raise ValueError(+ f"{path}: cue numbers must be consecutive from 1; "+ f"block {block_number} is numbered {cue_number}"+ )+ timing_match = _TIMING_RE.match(lines[1].strip())+ if timing_match is None:+ raise ValueError(+ f"{path}: invalid cue timing in block {block_number}"+ )+ start_ms = _timestamp_to_ms(timing_match.group("start"))+ end_ms = _timestamp_to_ms(timing_match.group("end"))+ cue_text = re.sub(r"\s+", " ", " ".join(lines[2:])).strip()+ if not cue_text:+ raise ValueError(f"{path}: empty cue text in block {block_number}")+ if end_ms <= start_ms:+ raise ValueError(+ f"{path}: cue {block_number} must end after it starts"+ )+ if start_ms < previous_end:+ raise ValueError(+ f"{path}: cue {block_number} overlaps the preceding cue"+ )+ cues.append(SubtitleCue(start_ms, end_ms, cue_text))+ previous_end = end_ms++ if not cues:+ raise ValueError(f"No subtitle cues found: {path}")+ return cues+++def _display_length(text: str) -> int:+ return sum(not character.isspace() for character in text)+++def _hard_split(text: str, max_chars: int) -> list[str]:+ """Split an overlong clause without dropping characters."""+ output: list[str] = []+ remaining = text.strip()+ while _display_length(remaining) > max_chars:+ visible = 0+ split_at = 0+ whitespace_split = 0+ for index, character in enumerate(remaining, 1):+ if character.isspace():+ whitespace_split = index+ continue+ visible += 1+ if visible > max_chars:+ break+ split_at = index+ if whitespace_split and whitespace_split <= split_at:+ split_at = whitespace_split+ if split_at <= 0:+ raise ValueError("Unable to split an overlong subtitle clause")+ output.append(remaining[:split_at].strip())+ remaining = remaining[split_at:].strip()+ if remaining:+ output.append(remaining)+ return output+++def _split_sentence(text: str, max_chars: int) -> list[str]:+ """Keep one sentence unless its display length requires clause splitting."""+ sentence = re.sub(r"\s+", " ", text).strip()+ if _display_length(sentence) <= max_chars:+ return [sentence]++ clauses: list[str] = []+ start = 0+ for index, character in enumerate(sentence):+ if character not in _CLAUSE_END:+ continue+ clause = sentence[start:index + 1].strip()+ if clause:+ clauses.append(clause)+ start = index + 1+ tail = sentence[start:].strip()+ if tail:+ clauses.append(tail)++ atoms = [+ part+ for clause in clauses+ for part in _hard_split(clause, max_chars)+ ]+ output: list[str] = []+ for atom in atoms:+ if not output:+ output.append(atom)+ continue+ candidate = f"{output[-1]}{atom}"+ if _display_length(candidate) <= max_chars:+ output[-1] = candidate+ else:+ output.append(atom)+ return output+++def _page_subtitle_paths(subtitle_dir: Path) -> list[Path]:+ """Resolve the ordered page-local SRT set without reading notes."""+ paths = [+ path+ for path in sorted(subtitle_dir.glob("*.srt"))+ if path.stem != "total"+ ]+ if not paths:+ raise FileNotFoundError(+ f"No page-local Edge SRT files found under {subtitle_dir}"+ )+ return paths+++def _frozen_transcript_lines(+ subtitle_dir: Path,+ max_chars: int,+) -> list[str]:+ """Return display lines derived from the exact text used for TTS."""+ lines: list[str] = []+ for path in _page_subtitle_paths(subtitle_dir):+ for cue in _parse_srt(path):+ lines.extend(_split_sentence(cue.text, max_chars))+ if not lines:+ raise ValueError("The page-local SRT set contains no narration text")+ return lines+++def _require_stable_whisper() -> Any:+ try:+ import stable_whisper+ except ImportError as exc:+ raise RuntimeError(+ "Final-video subtitle alignment requires stable-ts. "+ "Install it with: python3 -m pip install stable-ts"+ ) from exc+ return stable_whisper+++def _text_key(text: str) -> str:+ return "".join(character for character in text if not character.isspace())+++def align_video_subtitles(+ *,+ video_path: Path,+ subtitle_dir: Path,+ output_path: Path,+ language: str,+ model_name: str,+ device: str | None,+ max_chars: int,+ force: bool,+) -> tuple[int, int]:+ """Align frozen narration text to the final video's actual audio track."""+ if not video_path.is_file():+ raise FileNotFoundError(f"Finished video does not exist: {video_path}")+ if shutil.which("ffmpeg") is None:+ raise RuntimeError(+ "Final-video subtitle alignment requires ffmpeg on PATH"+ )+ if max_chars < 1:+ raise ValueError("max_chars must be at least 1")+ if output_path.resolve() == video_path.resolve():+ raise ValueError("Subtitle output must not overwrite the finished video")+ if output_path.exists() and not force:+ raise FileExistsError(+ f"Output already exists: {output_path}; pass --force to replace it"+ )++ transcript_lines = _frozen_transcript_lines(+ subtitle_dir,+ max_chars,+ )+ transcript = "\n".join(transcript_lines)+ stable_whisper = _require_stable_whisper()+ load_options: dict[str, Any] = {}+ if device:+ load_options["device"] = device+ model = stable_whisper.load_model(model_name, **load_options)+ result = model.align(+ str(video_path),+ transcript,+ language=language,+ original_split=True,+ )+ if result is None:+ raise RuntimeError("stable-ts could not align the narration transcript")++ output_path.parent.mkdir(parents=True, exist_ok=True)+ descriptor, temporary_name = tempfile.mkstemp(+ prefix=f".{output_path.stem}.",+ suffix=".srt",+ dir=str(output_path.parent),+ )+ os.close(descriptor)+ temporary_path = Path(temporary_name)+ try:+ result.to_srt_vtt(+ str(temporary_path),+ segment_level=True,+ word_level=False,+ )+ output_cues = _parse_srt(temporary_path)+ output_text = _text_key("".join(cue.text for cue in output_cues))+ expected_text = _text_key("".join(transcript_lines))+ if output_text != expected_text:+ raise RuntimeError(+ "Aligned subtitle text differs from the frozen TTS transcript; "+ "the final SRT was not published"+ )+ if len(output_cues) != len(transcript_lines):+ raise RuntimeError(+ "stable-ts did not preserve the requested sentence/line "+ "boundaries; the final SRT was not published"+ )+ os.replace(temporary_path, output_path)+ finally:+ temporary_path.unlink(missing_ok=True)+ return len(transcript_lines), output_cues[-1].end_ms+++def build_parser() -> argparse.ArgumentParser:+ parser = argparse.ArgumentParser(+ description=__doc__,+ formatter_class=argparse.RawDescriptionHelpFormatter,+ )+ parser.add_argument("project_path", type=Path, help="Project directory")+ parser.add_argument(+ "--video",+ required=True,+ help="Finished PowerPoint-exported video; relative paths are project-relative",+ )+ parser.add_argument(+ "--language",+ required=True,+ help="Narration language passed to stable-ts, e.g. zh, en, ja, or ko",+ )+ parser.add_argument(+ "--subtitle-dir",+ default=None,+ help="Page-local Edge SRT directory; default: <project>/notes/subtitles",+ )+ parser.add_argument(+ "-o",+ "--output",+ default=None,+ help="Final SRT path; default: beside the video with the same stem",+ )+ parser.add_argument(+ "--model",+ default="base",+ help="Whisper model used only for forced alignment (default: base)",+ )+ parser.add_argument(+ "--device",+ default=None,+ help="Optional stable-ts device, e.g. cpu or cuda",+ )+ parser.add_argument(+ "--max-chars",+ type=int,+ default=DEFAULT_MAX_CHARS,+ help="Maximum non-space characters per final subtitle cue (default: 20)",+ )+ parser.add_argument(+ "--force",+ action="store_true",+ help="Replace an existing final SRT",+ )+ return parser+++def main(argv: list[str] | None = None) -> int:+ parser = build_parser()+ args = parser.parse_args(argv)+ project_path = args.project_path.resolve()+ if not project_path.is_dir():+ parser.error(f"Project path does not exist: {project_path}")++ video_path = Path(args.video)+ if not video_path.is_absolute():+ video_path = project_path / video_path+ video_path = video_path.resolve()+ subtitle_dir = (+ Path(args.subtitle_dir)+ if args.subtitle_dir+ else Path("notes/subtitles")+ )+ if not subtitle_dir.is_absolute():+ subtitle_dir = project_path / subtitle_dir+ output_path = Path(args.output) if args.output else video_path.with_suffix(".srt")+ if not output_path.is_absolute():+ output_path = project_path / output_path++ try:+ cue_count, final_end_ms = align_video_subtitles(+ video_path=video_path,+ subtitle_dir=subtitle_dir.resolve(),+ output_path=output_path.resolve(),+ language=args.language,+ model_name=args.model,+ device=args.device,+ max_chars=args.max_chars,+ force=args.force,+ )+ except (OSError, RuntimeError, ValueError) as exc:+ print(f"Error: {exc}", file=sys.stderr)+ return 1++ print(output_path.resolve())+ print(+ f"Aligned {cue_count} final-video subtitle cue(s); "+ f"last cue ends at {final_end_ms / 1000:.3f}s",+ file=sys.stderr,+ )+ return 0+++if __name__ == "__main__":+ raise SystemExit(main())diff --git a/skills/ppt-master/workflows/stages/generate-audio.md b/skills/ppt-master/workflows/stages/generate-audio.mdindex 939244a1..9a79a03f 100644--- a/skills/ppt-master/workflows/stages/generate-audio.md+++ b/skills/ppt-master/workflows/stages/generate-audio.md@@ -143,7 +143,7 @@ python3 skills/ppt-master/scripts/notes_to_audio.py <project_path> \--provider cosyvoice --voice-id <chosen-voice> \--cosyvoice-model cosyvoice-v3-flash-# 2A. Generate PPTX caller with Edge SRT: rebuild click-free object timings+# 2A. Derive click-free narration timings from the existing custom animationpython3 skills/ppt-master/scripts/narration_sync.py animations <project_path> \--narration-padding 0.5 --force@@ -151,22 +151,35 @@ python3 skills/ppt-master/scripts/narration_sync.py animations <project_path> \python3 skills/ppt-master/scripts/svg_to_pptx.py <project_path> \--no-merge --recorded-narration audio --narration-padding 0.5+# Optional: use the canonical presentation animation instead+python3 skills/ppt-master/scripts/svg_to_pptx.py <project_path> \+ --no-merge --recorded-narration audio --narration-padding 0.5 \+ --animation-config animations.json++# Optional: export narration with no object or page-transition animation+python3 skills/ppt-master/scripts/svg_to_pptx.py <project_path> \+ --no-merge --recorded-narration audio --narration-padding 0.5 \+ --no-animations+# 2C. Merge page-local SRT against timing values read from the final PPTXpython3 skills/ppt-master/scripts/narration_sync.py subtitles <project_path> \--pptx <final_narrated_pptx> --force-# 2D. Optional after PowerPoint exports the video: calibrate page starts against-# the actual video audio and write a same-stem sidecar SRT-python3 skills/ppt-master/scripts/narration_sync.py subtitles <project_path> \- --pptx <final_narrated_pptx> --video <powerpoint_exported_video> \- -o exports/<powerpoint_exported_video_stem>.srt --force+# 2D. After PowerPoint exports the video, align the frozen narration text+# against the finished video's actual audio track+python3 skills/ppt-master/scripts/video_subtitles.py <project_path> \+ --video <powerpoint_exported_video> --language <language> --force```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.-The edge command writes each MP3 and its SRT from the same `edge-tts` stream. SRT cues use the stream's `WordBoundary` timing: sentence-ending punctuation always closes a cue; text over the default 20-character limit first splits at commas, semicolons, or colons, then at the nearest word boundary only when still too long. Each SRT uses a page-local timeline whose origin is `00:00:00,000`, including any leading silence before the first cue. Override the limit with `--subtitle-max-chars`. Cloud-provider commands currently write audio only.+The edge command writes each MP3 and its internal page SRT from the same `edge-tts` stream. Every cue is the service's native `SentenceBoundary` text, offset, and duration; the audio stage does not re-segment it or edit the notes. Each SRT uses a page-local timeline whose origin is `00:00:00,000`, including any leading silence before the first cue. Cloud-provider commands currently write audio only.++**Narration animation ownership**: `animations.json` must already exist and remains read-only. The audio stage deep-copies it to `narration_animations.json`, preserves transitions, effects, durations, order, and explicit `effect: none`, then changes only the derived trigger/delay values needed for click-free narration playback. It first resolves the sequence from `animations.json` and page SRT. When a sparse sidecar cannot identify every effective group, it reads only the affected SVG page as a read-only fallback; it never edits SVG, notes, or `animations.json`. Without a timing plan, ordered animated groups map to ordered sentence cues and unmatched groups keep their canonical relative delay.++**Narrated export animation selection**: `--recorded-narration` defaults to `<project_path>/narration_animations.json` and fails with a repair hint when that file is missing. Pass `--animation-config animations.json` to keep the canonical presentation animation, or `--no-animations` to disable both object animations and page-transition motion while preserving narration audio and recorded slide-advance timings. Non-narrated export keeps its existing optional `<project_path>/animations.json` default.-**Generate PPTX narration timing plan**: before `narration_sync.py animations`, compare every current SVG content group with that page's SRT and write `<project_path>/narration_timing.json`. Pin the plan to the ordered page-local SRT set with `srt_sha256`, and record the same `narration_padding` that the later PPTX export will use. Each slide contains one ordered `groups` list. Set `cue` to the matching 1-based SRT cue number; omit `cue` when the group has no spoken counterpart. The list must cover every non-static content group exactly once. The sync command rejects a stale SRT fingerprint, then rebuilds `animations.json` from scratch with `after-previous` timing; it does not migrate legacy narration fields. Matched groups wait for their cue, while unmatched groups follow the preceding animation with the page rhythm's normal stagger.+An existing `<project_path>/narration_timing.json` remains an optional explicit mapping for ambiguous pages. It is fingerprinted to the ordered SRT set; `cue` is the 1-based sentence cue, and omitted `cue` keeps that group's canonical relative delay.Get the exact fingerprint value with:@@ -190,9 +203,9 @@ python3 skills/ppt-master/scripts/narration_sync.py fingerprint <project_path>}```-After the narrated PPTX is exported, `narration_sync.py subtitles` reads the actual presentation relationship order plus integer `advTm` and transition duration from every slide, then writes `<project_path>/notes/subtitles/total.srt`. Relative `--pptx` paths are project-relative. This produces the deck-wide SRT on the native PPTX timeline, including page transitions and narration padding.+`narration_sync.py subtitles` may still write `<project_path>/notes/subtitles/total.srt` as a PPTX-timeline diagnostic. It is not the delivery subtitle for a finished video.-PowerPoint video export may quantize each slide/media segment to the video frame clock, creating small page-boundary differences that accumulate across a long deck. When the finished video exists, pass it with `--video`. The command correlates each original page narration with the exported audio track and replaces only the theoretical page offsets; it preserves every page-local cue and rejects weak matches. This optional post-export calibration does not create or rewrite MP4.+After PowerPoint exports the video, `video_subtitles.py` takes the exact narration text frozen in the page SRT set and force-aligns it against the finished video's actual audio track with `stable-ts`. Long delivery cues may be split for display at this final stage. This writes a same-stem external SRT without changing the MP4, notes, page SRT, or animation files.This stage keeps subtitles as external SRT files. It does not embed subtitles into PPTX or export MP4 directly.@@ -200,7 +213,7 @@ This stage keeps subtitles as external SRT files. It does not embed subtitles in| Caller | After audio generation ||---|---|-| Generate PPTX | With Edge SRT, rebuild animations, export with `--recorded-narration audio`, then merge `total.srt` from the final PPTX. If PowerPoint later exports a video, optionally rerun the merge with `--video` for exact sidecar alignment. |+| Generate PPTX | With Edge SRT and an existing `animations.json`, derive `narration_animations.json`, export with `--recorded-narration audio` (derived animation by default; canonical or no-animation modes remain explicit), and generate the delivery SRT only after PowerPoint exports the video. || Enhance Native PPTX | Return to [`native-enhance-pptx`](../native-enhance-pptx.md) Step 9; its `apply` command owns audio relationships, timings, transitions, and the enhanced export |For Generate PPTX, `--recorded-narration audio` prepares PowerPoint's recorded timings and narrations: every slide must have a matching supported audio file, every duration must be readable by `ffprobe`, and object animations must not use `--animation-trigger on-click`. Use `after-previous` or `with-previous` for narrated/video export. Narration changes the slide-advance layer only: the resolved page-transition effect remains unchanged, `-t none` remains visually transition-free, and narration advance disables click while using audio duration plus padding. The re-export is saved as `exports/<project_name>_<timestamp>_narrated.pptx`, telling it apart from silent exports.@@ -215,8 +228,8 @@ Output one summary block listing:- Number of audio files generated and their location (`<project_path>/audio/*`).- For edge, number of matching page-local SRT files and their location (`<project_path>/notes/subtitles/*`).-- For Generate PPTX with Edge SRT, rebuilt animation group count and merged SRT path (`<project_path>/notes/subtitles/total.srt`).-- When `--video` was used, the calibrated sidecar SRT path, page-offset adjustment range, and minimum audio-correlation score.+- For Generate PPTX with Edge SRT, derived narration animation group count and `narration_animations.json` path.+- When a finished video was supplied, the final aligned sidecar SRT path.- The provider, voice, and rate/settings actually used.- The caller-owned integration result: narrated SVG export path, enhanced native PPTX path, or “audio only”.- For Generate PPTX when embedding was skipped, one-line hint: `python3 skills/ppt-master/scripts/svg_to_pptx.py <project_path> --recorded-narration audio`.