Skip to main content

Muting Audio

You may pass in the muted prop to <Audio>, <OffthreadVideo> and <Video> and even change it over time.

When muted is true, audio will be omitted at that time. In the following example, we are muting the track between seconds 2 and 4.

tsx
import {AbsoluteFill, Audio, staticFile, useCurrentFrame, useVideoConfig} from 'remotion';
 
export const MyComposition = () => {
const frame = useCurrentFrame();
const {fps} = useVideoConfig();
 
return (
<AbsoluteFill>
<Audio src={staticFile('audio.mp3')} muted={frame >= 2 * fps && frame <= 4 * fps} />
</AbsoluteFill>
);
};