{"record":{"id":"f15a3f01d7b215b2","repo":"remotion-dev/remotion","slug":"audio-must-be-base-foreground-both-or-none","errorCode":null,"errorMessage":"audio must be base, foreground, both, or none.","messagePattern":"audio must be base, foreground, both, or none\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/studio/src/components/WebMcp.tsx","lineNumber":709,"sourceCode":"\t\t\t\t\t\tif (typeof modelName !== 'string') {\n\t\t\t\t\t\t\tthrow new Error('model must be a string.');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst model = videoMatting\n\t\t\t\t\t\t\t.getAvailableModels()\n\t\t\t\t\t\t\t.find((candidate) => candidate.name === modelName)?.name;\n\t\t\t\t\t\tif (!model) {\n\t\t\t\t\t\t\tthrow new Error(`Unknown video matting model: ${modelName}.`);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst audio = input.audio ?? 'base';\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\taudio !== 'base' &&\n\t\t\t\t\t\t\taudio !== 'foreground' &&\n\t\t\t\t\t\t\taudio !== 'both' &&\n\t\t\t\t\t\t\taudio !== 'none'\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tthrow new Error('audio must be base, foreground, both, or none.');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst videoBitrate = input.videoBitrate ?? 'very-high';\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t(typeof videoBitrate !== 'number' ||\n\t\t\t\t\t\t\t\t!Number.isInteger(videoBitrate) ||\n\t\t\t\t\t\t\t\tvideoBitrate <= 0) &&\n\t\t\t\t\t\t\tvideoBitrate !== 'very-low' &&\n\t\t\t\t\t\t\tvideoBitrate !== 'low' &&\n\t\t\t\t\t\t\tvideoBitrate !== 'medium' &&\n\t\t\t\t\t\t\tvideoBitrate !== 'high' &&\n\t\t\t\t\t\t\tvideoBitrate !== 'very-high'\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tthrow new Error('videoBitrate is invalid.');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst src = staticFile(assetPath);\n\t\t\t\t\t\tconst displayName = assetPath.split('/').at(-1) ?? assetPath;","sourceCodeStart":691,"sourceCodeEnd":727,"githubUrl":"https://github.com/remotion-dev/remotion/blob/b2f4e34732f3c6c222ea029413e22dc402218cd7/packages/studio/src/components/WebMcp.tsx#L691-L727","documentation":"Thrown when the optional `input.audio` option of the video-matting tool is not one of the four allowed literals: 'base', 'foreground', 'both', or 'none'. It controls which audio track the separated outputs keep.","triggerScenarios":"Passing audio: 'original', 'Base' (wrong case), 'bgs', a number, or any other value outside the four-case union.","commonSituations":"Guessing option names instead of reading the tool schema, uppercase/lowercase mixups, or agents inventing values like 'background-audio'.","solutions":["Use exactly one of 'base' | 'foreground' | 'both' | 'none' (lowercase).","Omit the field to use the default 'base'.","Map your intent (e.g. keep original audio) to the closest allowed value before calling."],"exampleFix":"// before\n{ audio: 'background' }\n// after\n{ audio: 'base' }","handlingStrategy":"validation","validationCode":"const AUDIO = ['base','foreground','both','none'] as const;\nif (audio != null && !AUDIO.includes(audio)) throw new Error('audio must be base|foreground|both|none');","typeGuard":"const isAudioMode = (v: unknown): v is 'base'|'foreground'|'both'|'none' => v === 'base' || v === 'foreground' || v === 'both' || v === 'none';","tryCatchPattern":null,"preventionTips":["Use only the four documented lowercase values.","Omit the field to accept the default.","Map synonyms (e.g. 'background') to 'base' in your caller code."],"tags":["validation","enum","video-matting"],"backgroundTag":"invalid-enum-value","analyzedSha":"b2f4e34732f3c6c222ea029413e22dc402218cd7","analyzedAt":"2026-09-09T13:27:51.281Z","contentChangedAt":"2026-09-09T13:27:51.281Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}