Using the audio visualization APIs in Remotion 2.0, you can create animations based on the frequency of the audio. This is often used to make graphics react to the volume or sound spectrum of the music.
You can import an audio file using an
audio will resolve to a string pointing to an audio file. You may also skip importing and use an
https:// URL to load audio from a remote location, if the audio is allowed to be loaded by the domains CORS policy.
@remotion/media-utils package provides helper functions for reading and processing audio. Using the
getAudioData() API you can read audio, and using the
useAudioData() helper hook you can load this audio data directly into your component.
visualizeAudio() API, you can get an audio spectrum for the current frame, with the
numberOfSamples parameter being an option to control the amount of detail you need.
Refer to the documentation of the above mentioned functions to learn more.