{"record":{"id":"936eb43b221f9482","repo":"calesthio/OpenMontage","slug":"each-reference-audio-duration-must-be-2-to-max-re","errorCode":null,"errorMessage":"each reference audio duration must be 2 to {max_reference_seconds} seconds","messagePattern":"each reference audio duration must be 2 to (.+?) seconds","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"tools/video/seedance_ark.py","lineNumber":830,"sourceCode":"            if inputs.get(\"reference_audio_path\"):\n                audio_refs.append(inputs[\"reference_audio_path\"])\n            if len(audio_refs) > max_audios:\n                raise ValueError(\n                    \"reference_to_video accepts at most 3 reference audio \"\n                    f\"clips (maximum {max_audios})\"\n                )\n            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                )","sourceCodeStart":812,"sourceCodeEnd":848,"githubUrl":"https://github.com/calesthio/OpenMontage/blob/95e1c3d0ab93482159818560f6a8c8e866b9139f/tools/video/seedance_ark.py#L812-L848","documentation":"Raised when any entry in reference_audio_durations is under 2 seconds or over the reference cap (15s standard variants, 30s on 2.5). Each audio clip hint must fall inside the window Ark can actually use.","triggerScenarios":"A durations entry of 1, 0.5, 20 (non-2.5), or 45 (2.5); passing milliseconds like 3000 instead of seconds.","commonSituations":"Referencing very short stingers or long music beds; assuming audio has no duration limits; unit confusion between ms and s.","solutions":["Clamp each duration entry to the 2..15 (or 2..30 on 2.5) range","Trim or loop source audio so the referenced window is inside the range","Use model_variant='2.5' for clips up to 30s"],"exampleFix":"# before\ninputs = {\"reference_audio_durations\": [1, 3000]}\n\n# after\ninputs = {\"reference_audio_durations\": [2, 15]}","handlingStrategy":"validation","validationCode":"max_s = 30 if str(inputs.get(\"model_variant\", \"standard\")).lower() == \"2.5\" else 15\nassert all(2 <= float(d) <= max_s for d in inputs.get(\"reference_audio_durations\") or [])","typeGuard":"def valid_audio_durations(durations: list, max_s: int = 15) -> bool:\n    return all(2 <= float(d) <= max_s for d in durations or [])","tryCatchPattern":null,"preventionTips":["Reject ms-scale values (>1000) at the boundary as a units bug","Trim source audio to the window you reference"],"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"}