Capítulo 832 de 988

Chapter 832: Adding music

Core Idea

To underlay your video with music, use one of the three soundtracks provided by the Remotion Recorder or add your own.

Key Concepts

  • Add music
  • Provided Soundtracks
  • Add your background music
  • Changing music
  • Stopping music

Code Examples

export const music = z.enum([
  "previous",
  "none",
  "somesong",
  // You can give your song any label. This is the name you will see in the editor.
  "<your-song-label>",
]);

export const getAudioSource = (track: Music) => {
  if (track === "somesong") {
    return staticFile("sounds/soundtrack1.mp3");
  }

  // Add your track here. The label has to match the one you added above.
  if (track === "<your-song-label>") {
    return staticFile("sounds/<actual-asset-name>");
  }
};
  • What it demonstrates: Usage pattern for Adding music from the official docs.

Key Takeaways

  1. Understand add music when working with Adding music.
  2. Understand provided soundtracks when working with Adding music.
  3. Understand add your background music when working with Adding music.
  4. Understand changing music when working with Adding music.
  5. Understand stopping music when working with Adding music.

Connects To

  • Captions: related page in the Recorder (@remotion/recorder) section.
  • Create: related page in the Recorder (@remotion/recorder) section.
  • Demo: related page in the Recorder (@remotion/recorder) section.