{"record":{"id":"4090d7924e211493","repo":"remotion-dev/remotion","slug":"tried-to-simultaneously-mount-numberofaudiotags","errorCode":null,"errorMessage":"Tried to simultaneously mount ${numberOfAudioTags + 1} <Html5Audio /> tags at the same time. With the current settings, the maximum amount of <Html5Audio /> tags is limited to ${numberOfAudioTags} at the same time. Remotion pre-mounts silent audio tags to help avoid browser autoplay restrictions. See https://remotion.dev/docs/player/autoplay#using-the-numberofsharedaudiotags-prop for more information on how to increase this limit.","messagePattern":"Tried to simultaneously mount (.+?) <Html5Audio /> tags at the same time\\. With the current settings, the maximum amount of <Html5Audio /> tags is limited to (.+?) at the same time\\. Remotion pre-mounts silent audio tags to help avoid browser autoplay restrictions\\. See https://remotion\\.dev/docs/player/autoplay#using-the-numberofsharedaudiotags-prop for more information on how to increase this limit\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/core/src/audio/shared-audio-tags.tsx","lineNumber":695,"sourceCode":"\t\t});\n\t}, [refs]);\n\n\tconst registerAudio = useCallback(\n\t\t(options: {\n\t\t\taud: AudioHTMLAttributes<HTMLAudioElement>;\n\t\t\taudioId: string;\n\t\t\tpremounting: boolean;\n\t\t\tpostmounting: boolean;\n\t\t}) => {\n\t\t\tconst {aud, audioId, premounting, postmounting} = options;\n\t\t\tconst found = audios.current?.find((a) => a.audioId === audioId);\n\t\t\tif (found) {\n\t\t\t\treturn found;\n\t\t\t}\n\n\t\t\tconst firstFreeAudio = takenAudios.current.findIndex((a) => a === false);\n\t\t\tif (firstFreeAudio === -1) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Tried to simultaneously mount ${\n\t\t\t\t\t\tnumberOfAudioTags + 1\n\t\t\t\t\t} <Html5Audio /> tags at the same time. With the current settings, the maximum amount of <Html5Audio /> tags is limited to ${numberOfAudioTags} at the same time. Remotion pre-mounts silent audio tags to help avoid browser autoplay restrictions. See https://remotion.dev/docs/player/autoplay#using-the-numberofsharedaudiotags-prop for more information on how to increase this limit.`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst {id, ref, mediaElementSourceNode} = refs[firstFreeAudio];\n\t\t\tconst cloned = [...takenAudios.current];\n\t\t\tcloned[firstFreeAudio] = id;\n\t\t\ttakenAudios.current = cloned;\n\n\t\t\tconst newElem: AudioElem = {\n\t\t\t\tprops: aud,\n\t\t\t\tid,\n\t\t\t\tel: ref,\n\t\t\t\taudioId,\n\t\t\t\tmediaElementSourceNode,\n\t\t\t\tpremounting,","sourceCodeStart":677,"sourceCodeEnd":713,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/core/src/audio/shared-audio-tags.tsx#L677-L713","documentation":"Remotion pre-mounts a fixed number of silent <audio> tags (numberOfSharedAudioTags, default 0 in many setups, higher in Player) to work around browser autoplay policies. When more <Html5Audio> elements mount simultaneously than available tags, registerAudio cannot find a free slot and throws. The limit exists because each audio tag is a pre-allocated, reused resource.","triggerScenarios":"Mounting N+1 <Html5Audio> components at the same frame when numberOfSharedAudioTags is N. Common with many overlapping audio tracks, a music+voice+sfx layer, or dynamically rendered lists of audio elements.","commonSituations":"Adding a new voiceover track on top of existing music and SFX; rendering a list of audio tags from data; default Player numberOfSharedAudioTags being too low for a scene with many simultaneous sounds.","solutions":["Increase numberOfSharedAudioTags on <Player> to at least the maximum number of <Html5Audio> tags that play at once (see https://remotion.dev/docs/player/autoplay#using-the-numberofsharedaudiotags-prop).","Stagger audio with <Sequence> so fewer tags are simultaneous.","Consolidate overlapping audio into a single pre-mixed track."],"exampleFix":"// before\n<Player numberOfSharedAudioTags={2} component={Comp} ... />\n// Comp renders 4 <Html5Audio> at once\n\n// after\n<Player numberOfSharedAudioTags={4} component={Comp} ... />","handlingStrategy":"validation","validationCode":"const maxSimultaneous = countSimultaneousAudio(composition);\n// ensure numberOfSharedAudioTags >= maxSimultaneous before mounting <Player>","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Count the maximum number of <Html5Audio> tags that overlap at any frame and set numberOfSharedAudioTags higher.","Stagger audio with <Sequence> to reduce simultaneous tags.","Add a runtime check in dev that warns when the count approaches the limit."],"tags":["audio","player","validation","react","autoplay","html5-audio"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}