@glissade/cli 0.4.4 → 0.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/music.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { o as resolveAssetPath } from "./audioMix.js";
1
2
  import { existsSync, readFileSync } from "node:fs";
2
3
  import { music, validateMusicTiming } from "@glissade/narrate";
3
4
  //#region src/music.ts
@@ -35,5 +36,20 @@ function buildMusicClip(musicManifestPath, narrationTimingPath) {
35
36
  note: `music bed '${timing.stem}'${timing.gainDb ? ` at ${timing.gainDb}dB` : ""}`
36
37
  };
37
38
  }
39
+ /**
40
+ * True when the timeline's audio already references the bed stem (same
41
+ * resolved file) — auto-mix must then SKIP, or the bed plays twice and adds
42
+ * +6dB of coherent doubling (measured downstream before this guard existed).
43
+ */
44
+ function bedAlreadyReferenced(clips, bedUrl, modulePath) {
45
+ const bedPath = resolveAssetPath(bedUrl, modulePath);
46
+ return clips.some((c) => {
47
+ try {
48
+ return resolveAssetPath(c.asset.url, modulePath) === bedPath;
49
+ } catch {
50
+ return false;
51
+ }
52
+ });
53
+ }
38
54
  //#endregion
39
- export { buildMusicClip, musicPathFor };
55
+ export { bedAlreadyReferenced, buildMusicClip, musicPathFor };
package/dist/render.js CHANGED
@@ -132,11 +132,12 @@ async function render(opts) {
132
132
  ];
133
133
  const audioClips = [...compiled.audio];
134
134
  if ((opts.music ?? "auto") === "auto") {
135
- const { buildMusicClip, musicPathFor } = await import("./music.js");
135
+ const { bedAlreadyReferenced, buildMusicClip, musicPathFor } = await import("./music.js");
136
136
  const musicPath = musicPathFor(opts.modulePath);
137
137
  if (musicPath) {
138
138
  const bed = buildMusicClip(musicPath, timingPathFor(opts.modulePath));
139
- if (bed) {
139
+ if (bed) if (bedAlreadyReferenced(audioClips, bed.clip.asset.url, opts.modulePath)) process.stderr.write("note: music bed already in the timeline audio — auto-mix skipped\n");
140
+ else {
140
141
  audioClips.push(bed.clip);
141
142
  process.stderr.write(`note: auto-mixing ${bed.note}\n`);
142
143
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glissade/cli",
3
- "version": "0.4.4",
3
+ "version": "0.4.5",
4
4
  "description": "glissade CLI: headless rendering via backend-skia (+ FFmpeg mux).",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -20,13 +20,13 @@
20
20
  "@napi-rs/canvas": "^0.1.65",
21
21
  "esbuild": "^0.28.0",
22
22
  "jiti": "^2.4.2",
23
- "@glissade/backend-skia": "0.4.4",
24
- "@glissade/core": "0.4.4",
25
- "@glissade/interact": "0.4.4",
26
- "@glissade/lottie": "0.4.4",
27
- "@glissade/narrate": "0.4.4",
28
- "@glissade/player": "0.4.4",
29
- "@glissade/scene": "0.4.4"
23
+ "@glissade/backend-skia": "0.4.5",
24
+ "@glissade/core": "0.4.5",
25
+ "@glissade/interact": "0.4.5",
26
+ "@glissade/lottie": "0.4.5",
27
+ "@glissade/narrate": "0.4.5",
28
+ "@glissade/player": "0.4.5",
29
+ "@glissade/scene": "0.4.5"
30
30
  },
31
31
  "repository": {
32
32
  "type": "git",