Skip to content

armgit / hypit

Public Imported from GitHub
0

Clone any viral video with AI agents. Not just a script, the whole workflow: swap the face, the words, the B-roll, ship 100 variants in one command, and get your 100M views.

fix(seedance): reject m4a reference audio at runtime binding

rpone615c4df63acf
diff --git a/packages/seedance/src/index.ts b/packages/seedance/src/index.ts
index 21c1d507..8c0112a1 100644
--- a/packages/seedance/src/index.ts
+++ b/packages/seedance/src/index.ts
@@ -326,7 +326,24 @@ export const seedanceMarkupSurfaces = [
/** The duration is an author literal on every Seedance Surface, so the manifest is the exact-model module's own. */
export const seedanceManifest = seedanceBaseDefinition.manifest;
-export const seedanceComponent = seedanceBaseDefinition.component;
+
+const referenceAudioProducers = new Set(Object.values(seedanceEndpoints)
+ .map((endpoint) => endpoint.mediaBindings["referenceAudio"]!.producer.name));
+
+export const seedanceComponent = {
+ ...seedanceBaseDefinition.component,
+ producers: seedanceBaseDefinition.component.producers.map((facet) =>
+ referenceAudioProducers.has(facet.producer.name) ? {
+ ...facet,
+ handler: (context: Parameters<typeof facet.handler>[0]) => {
+ const artifact = context.inputs.artifact?.value;
+ if (artifact?.kind === "blob" && ["audio/mp4", "audio/x-m4a"].includes(artifact.mediaType)) {
+ throw new Error("Seedance reference audio does not accept m4a; convert to wav or mp3");
+ }
+ return facet.handler(context);
+ },
+ } : facet),
+};
export const seedanceDefinition = seedanceBaseDefinition;
export {