Using audio in Remotion
Prerequisites
First, the @remotion/media package needs to be installed. If it is not installed, use the following command:Importing Audio
Use<Audio> from @remotion/media to add audio to your composition.
<Audio> components.
Trimming
UsetrimBefore and trimAfter to remove portions of the audio. Values are in frames.
Delaying
Wrap the audio in a<Sequence> to delay when it starts:
Volume
Set a static volume (0 to 1):f starts at 0 when the audio begins to play, not the composition frame.
Muting
Usemuted to silence the audio. It can be set dynamically:
Speed
UseplaybackRate to change the playback speed:
Looping
Useloop to loop the audio indefinitely:
loopVolumeCurveBehavior to control how the frame count behaves when looping:
"repeat": Frame count resets to 0 each loop (default)"extend": Frame count continues incrementing
Pitch
UsetoneFrequency to adjust the pitch without affecting speed. Values range from 0.01 to 2:
<Player />.