{"record":{"id":"bb59a7cf37246d82","repo":"calesthio/OpenMontage","slug":"all-reference-audio-clips-together-must-be-at-most","errorCode":null,"errorMessage":"all reference audio clips together must be at most {max_reference_seconds} seconds","messagePattern":"all reference audio clips together must be at most (.+?) seconds","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"tools/video/seedance_ark.py","lineNumber":837,"sourceCode":"            audio_durations = list(inputs.get(\"reference_audio_durations\") or [])\n            if audio_durations:\n                if len(audio_durations) != len(audio_refs):\n                    raise ValueError(\n                        \"reference_audio_durations must match the number of \"\n                        \"reference audio clips\"\n                    )\n                if any(\n                    float(value) < 2 or float(value) > max_reference_seconds\n                    for value in audio_durations\n                ):\n                    raise ValueError(\n                        f\"each reference audio duration must be 2 to {max_reference_seconds} seconds\"\n                    )\n                if (\n                    sum(float(value) for value in audio_durations)\n                    > max_reference_seconds\n                ):\n                    raise ValueError(\n                        \"all reference audio clips together must be at most \"\n                        f\"{max_reference_seconds} seconds\"\n                    )\n            local_audio_durations = [\n                duration\n                for ref in audio_refs\n                if (\n                    duration := self._local_or_data_audio_duration(\n                        str(ref), max_seconds=max_reference_seconds\n                    )\n                )\n                is not None\n            ]\n            if sum(local_audio_durations) > max_reference_seconds:\n                raise ValueError(\n                    \"all local reference audio clips together must be at \"\n                    f\"most {max_reference_seconds} seconds\"\n                )","sourceCodeStart":819,"sourceCodeEnd":855,"githubUrl":"https://github.com/calesthio/OpenMontage/blob/95e1c3d0ab93482159818560f6a8c8e866b9139f/tools/video/seedance_ark.py#L819-L855","documentation":"Raised when the sum of reference_audio_durations exceeds the total reference budget (15s standard variants, 30s on 2.5). Individually valid clips can still break the combined cap, mirroring the video-side rule.","triggerScenarios":"Four valid 5-second audio durations on standard (20 > 15), or eleven 3-second clips on 2.5 (33 > 30).","commonSituations":"Stacking near-cap clips; assuming only per-clip duration is checked; porting a 2.5 workload back to a standard variant.","solutions":["Reduce durations or clip count until the sum is within 15 (or 30 on 2.5)","Concatenate clips into one file and reference it once","Switch to model_variant='2.5' for the larger budget"],"exampleFix":"# before\ninputs = {\"reference_audio_durations\": [5, 5, 5, 5]}  # 20 > 15\n\n# after\ninputs = {\"reference_audio_durations\": [5, 5, 5]}  # 15 ok","handlingStrategy":"validation","validationCode":"max_s = 30 if str(inputs.get(\"model_variant\", \"standard\")).lower() == \"2.5\" else 15\nassert sum(float(d) for d in inputs.get(\"reference_audio_durations\") or []) <= max_s","typeGuard":"def within_total_audio_budget(durations: list, max_s: int = 15) -> bool:\n    return sum(float(d) for d in durations or []) <= max_s","tryCatchPattern":null,"preventionTips":["Track one combined reference-seconds budget per request","Prefer one concatenated clip over many small ones"],"tags":["validation","seedance","ark","audio","durations","limits"],"backgroundTag":null,"analyzedSha":"95e1c3d0ab93482159818560f6a8c8e866b9139f","analyzedAt":"2026-08-15T06:31:20.014Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}