{"record":{"id":"55bfc0deee184f69","repo":"remotion-dev/remotion","slug":"you-have-passed-a-volume-below-0-to-your-compon","errorCode":null,"errorMessage":"You have passed a volume below 0 to your <${component} /> component. Volume must be between 0 and 1","messagePattern":"You have passed a volume below 0 to your <(.+?) /> component\\. Volume must be between 0 and 1","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/core/src/validate-media-props.ts","lineNumber":22,"sourceCode":"\tprops: {\n\t\tvolume: VolumeProp | undefined;\n\t\tplaybackRate: number | undefined;\n\t\tpreservePitch?: boolean | undefined;\n\t},\n\tcomponent: 'Html5Video' | 'Html5Audio' | 'Audio' | 'Video',\n) => {\n\tif (\n\t\ttypeof props.volume !== 'number' &&\n\t\ttypeof props.volume !== 'function' &&\n\t\ttypeof props.volume !== 'undefined'\n\t) {\n\t\tthrow new TypeError(\n\t\t\t`You have passed a volume of type ${typeof props.volume} to your <${component} /> component. Volume must be a number or a function with the signature '(frame: number) => number' undefined.`,\n\t\t);\n\t}\n\n\tif (typeof props.volume === 'number' && props.volume < 0) {\n\t\tthrow new TypeError(\n\t\t\t`You have passed a volume below 0 to your <${component} /> component. Volume must be between 0 and 1`,\n\t\t);\n\t}\n\n\tif (\n\t\ttypeof props.playbackRate !== 'number' &&\n\t\ttypeof props.playbackRate !== 'undefined'\n\t) {\n\t\tthrow new TypeError(\n\t\t\t`You have passed a playbackRate of type ${typeof props.playbackRate} to your <${component} /> component. Playback rate must a real number or undefined.`,\n\t\t);\n\t}\n\n\tif (\n\t\ttypeof props.playbackRate === 'number' &&\n\t\t(isNaN(props.playbackRate) ||\n\t\t\t!Number.isFinite(props.playbackRate) ||\n\t\t\tprops.playbackRate <= 0)","sourceCodeStart":4,"sourceCodeEnd":40,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/core/src/validate-media-props.ts#L4-L40","documentation":"validateMediaProps throws a TypeError when volume is a number but below 0. Remotion requires volume in the range [0, 1] (with values above 1 allowed to amplify); negative volume is meaningless and rejected. The message notes the valid range.","triggerScenarios":"Passing a negative number for volume; arithmetic that produces a negative (e.g. subtraction overshooting); interpolation ranges that dip below 0; data entry errors.","commonSituations":"Interpolate with an output range starting negative; volume computed from a curve that goes below zero; sign errors in math; user input of negative values.","solutions":["Clamp to 0: `volume={Math.max(0, v)}`.","Fix the interpolation output range to stay within [0, 1] (or higher for amplification).","Validate the source data for negative values.","Use the function form to clamp per-frame: `volume={(f) => Math.max(0, fn(f))}`."],"exampleFix":"// before\n<Audio src={url} volume={interpolate(frame, [0, 30], [-0.5, 1])} />\n\n// after\n<Audio src={url} volume={interpolate(frame, [0, 30], [0, 1])} />","handlingStrategy":"validation","validationCode":"const v = typeof volume === 'number' ? Math.max(0, volume) : volume;\n// then pass v","typeGuard":"const isNonNegativeNumber = (v: unknown): v is number => typeof v === 'number' && v >= 0;","tryCatchPattern":null,"preventionTips":["Clamp numeric volume to >= 0 (typically [0, 1]).","Keep interpolation output ranges within valid bounds.","Validate user-supplied volume values."],"tags":["remotion","audio","video","volume","validation","typeerror","bounds"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}