Skip to content

🎥 Make videos programmatically with React

Skills: Clarify `<Audio>` imports from `@remotion/media`

Jonny Burger8ba0b5075de6
diff --git a/packages/codex-plugin/skills/remotion-best-practices/remotion-markup/audio.md b/packages/codex-plugin/skills/remotion-best-practices/remotion-markup/audio.md
index 3a31e8ff74..0c14aff021 100644
--- a/packages/codex-plugin/skills/remotion-best-practices/remotion-markup/audio.md
+++ b/packages/codex-plugin/skills/remotion-best-practices/remotion-markup/audio.md
@@ -32,6 +32,8 @@ export const MyComposition = () => {
Remote URLs are also supported:
```tsx
+import { Audio } from "@remotion/media";
+
<Audio src="https://remotion.media/audio.mp3" />
```
@@ -43,6 +45,8 @@ Multiple audio tracks can be layered by adding multiple `<Audio>` components.
Use `trimBefore` and `trimAfter` to remove portions of the audio. Values are in frames.
```tsx
+import { Audio } from "@remotion/media";
+
const { fps } = useVideoConfig();
return (
@@ -78,12 +82,15 @@ The audio will start playing after 1 second.
Set a static volume (0 to 1):
```tsx
+import { Audio } from "@remotion/media";
+
<Audio src={staticFile("audio.mp3")} volume={0.5} />
```
Or use a callback for dynamic volume based on the current frame:
```tsx
+import { Audio } from "@remotion/media";
import { interpolate } from "remotion";
const { fps } = useVideoConfig();
@@ -105,6 +112,8 @@ The value of `f` starts at 0 when the audio begins to play, not the composition
Use `muted` to silence the audio. It can be set dynamically:
```tsx
+import { Audio } from "@remotion/media";
+
const frame = useCurrentFrame();
const { fps } = useVideoConfig();
@@ -121,6 +130,8 @@ return (
Use `playbackRate` to change the playback speed:
```tsx
+import { Audio } from "@remotion/media";
+
// 2x speed
<Audio src={staticFile("audio.mp3")} playbackRate={2} />
// Half speed
@@ -134,6 +145,8 @@ Reverse playback is not supported.
Use `loop` to loop the audio indefinitely:
```tsx
+import { Audio } from "@remotion/media";
+
<Audio src={staticFile("audio.mp3")} loop />
```
@@ -143,6 +156,8 @@ Use `loopVolumeCurveBehavior` to control how the frame count behaves when loopin
- `"extend"`: Frame count continues incrementing
```tsx
+import { Audio } from "@remotion/media";
+
<Audio
src={staticFile("audio.mp3")}
loop
@@ -156,6 +171,8 @@ Use `loopVolumeCurveBehavior` to control how the frame count behaves when loopin
Use `toneFrequency` to adjust the pitch without affecting speed. Values range from 0.01 to 2:
```tsx
+import { Audio } from "@remotion/media";
+
<Audio
src={staticFile("audio.mp3")}
toneFrequency={1.5} // Higher pitch
diff --git a/packages/codex-plugin/skills/remotion-best-practices/remotion-markup/sfx.md b/packages/codex-plugin/skills/remotion-best-practices/remotion-markup/sfx.md
index ba2dd83b11..9354fe7fbd 100644
--- a/packages/codex-plugin/skills/remotion-best-practices/remotion-markup/sfx.md
+++ b/packages/codex-plugin/skills/remotion-best-practices/remotion-markup/sfx.md
@@ -5,10 +5,10 @@ metadata:
tags: sfx, sound, effect, audio
---
-To include a sound effect, use the `<Audio>` tag:
+To include a sound effect, use `<Audio>` from `@remotion/media`:
```tsx
-import { Audio } from "@remotion/sfx";
+import { Audio } from "@remotion/media";
<Audio src={"https://remotion.media/whoosh.wav"} />;
```
diff --git a/packages/codex-plugin/skills/remotion-markup/audio.md b/packages/codex-plugin/skills/remotion-markup/audio.md
index 3a31e8ff74..0c14aff021 100644
--- a/packages/codex-plugin/skills/remotion-markup/audio.md
+++ b/packages/codex-plugin/skills/remotion-markup/audio.md
@@ -32,6 +32,8 @@ export const MyComposition = () => {
Remote URLs are also supported:
```tsx
+import { Audio } from "@remotion/media";
+
<Audio src="https://remotion.media/audio.mp3" />
```
@@ -43,6 +45,8 @@ Multiple audio tracks can be layered by adding multiple `<Audio>` components.
Use `trimBefore` and `trimAfter` to remove portions of the audio. Values are in frames.
```tsx
+import { Audio } from "@remotion/media";
+
const { fps } = useVideoConfig();
return (
@@ -78,12 +82,15 @@ The audio will start playing after 1 second.
Set a static volume (0 to 1):
```tsx
+import { Audio } from "@remotion/media";
+
<Audio src={staticFile("audio.mp3")} volume={0.5} />
```
Or use a callback for dynamic volume based on the current frame:
```tsx
+import { Audio } from "@remotion/media";
import { interpolate } from "remotion";
const { fps } = useVideoConfig();
@@ -105,6 +112,8 @@ The value of `f` starts at 0 when the audio begins to play, not the composition
Use `muted` to silence the audio. It can be set dynamically:
```tsx
+import { Audio } from "@remotion/media";
+
const frame = useCurrentFrame();
const { fps } = useVideoConfig();
@@ -121,6 +130,8 @@ return (
Use `playbackRate` to change the playback speed:
```tsx
+import { Audio } from "@remotion/media";
+
// 2x speed
<Audio src={staticFile("audio.mp3")} playbackRate={2} />
// Half speed
@@ -134,6 +145,8 @@ Reverse playback is not supported.
Use `loop` to loop the audio indefinitely:
```tsx
+import { Audio } from "@remotion/media";
+
<Audio src={staticFile("audio.mp3")} loop />
```
@@ -143,6 +156,8 @@ Use `loopVolumeCurveBehavior` to control how the frame count behaves when loopin
- `"extend"`: Frame count continues incrementing
```tsx
+import { Audio } from "@remotion/media";
+
<Audio
src={staticFile("audio.mp3")}
loop
@@ -156,6 +171,8 @@ Use `loopVolumeCurveBehavior` to control how the frame count behaves when loopin
Use `toneFrequency` to adjust the pitch without affecting speed. Values range from 0.01 to 2:
```tsx
+import { Audio } from "@remotion/media";
+
<Audio
src={staticFile("audio.mp3")}
toneFrequency={1.5} // Higher pitch
diff --git a/packages/codex-plugin/skills/remotion-markup/sfx.md b/packages/codex-plugin/skills/remotion-markup/sfx.md
index ba2dd83b11..9354fe7fbd 100644
--- a/packages/codex-plugin/skills/remotion-markup/sfx.md
+++ b/packages/codex-plugin/skills/remotion-markup/sfx.md
@@ -5,10 +5,10 @@ metadata:
tags: sfx, sound, effect, audio
---
-To include a sound effect, use the `<Audio>` tag:
+To include a sound effect, use `<Audio>` from `@remotion/media`:
```tsx
-import { Audio } from "@remotion/sfx";
+import { Audio } from "@remotion/media";
<Audio src={"https://remotion.media/whoosh.wav"} />;
```
diff --git a/packages/example/.agents/skills/remotion-markup/audio.md b/packages/example/.agents/skills/remotion-markup/audio.md
index 3a31e8ff74..0c14aff021 100644
--- a/packages/example/.agents/skills/remotion-markup/audio.md
+++ b/packages/example/.agents/skills/remotion-markup/audio.md
@@ -32,6 +32,8 @@ export const MyComposition = () => {
Remote URLs are also supported:
```tsx
+import { Audio } from "@remotion/media";
+
<Audio src="https://remotion.media/audio.mp3" />
```
@@ -43,6 +45,8 @@ Multiple audio tracks can be layered by adding multiple `<Audio>` components.
Use `trimBefore` and `trimAfter` to remove portions of the audio. Values are in frames.
```tsx
+import { Audio } from "@remotion/media";
+
const { fps } = useVideoConfig();
return (
@@ -78,12 +82,15 @@ The audio will start playing after 1 second.
Set a static volume (0 to 1):
```tsx
+import { Audio } from "@remotion/media";
+
<Audio src={staticFile("audio.mp3")} volume={0.5} />
```
Or use a callback for dynamic volume based on the current frame:
```tsx
+import { Audio } from "@remotion/media";
import { interpolate } from "remotion";
const { fps } = useVideoConfig();
@@ -105,6 +112,8 @@ The value of `f` starts at 0 when the audio begins to play, not the composition
Use `muted` to silence the audio. It can be set dynamically:
```tsx
+import { Audio } from "@remotion/media";
+
const frame = useCurrentFrame();
const { fps } = useVideoConfig();
@@ -121,6 +130,8 @@ return (
Use `playbackRate` to change the playback speed:
```tsx
+import { Audio } from "@remotion/media";
+
// 2x speed
<Audio src={staticFile("audio.mp3")} playbackRate={2} />
// Half speed
@@ -134,6 +145,8 @@ Reverse playback is not supported.
Use `loop` to loop the audio indefinitely:
```tsx
+import { Audio } from "@remotion/media";
+
<Audio src={staticFile("audio.mp3")} loop />
```
@@ -143,6 +156,8 @@ Use `loopVolumeCurveBehavior` to control how the frame count behaves when loopin
- `"extend"`: Frame count continues incrementing
```tsx
+import { Audio } from "@remotion/media";
+
<Audio
src={staticFile("audio.mp3")}
loop
@@ -156,6 +171,8 @@ Use `loopVolumeCurveBehavior` to control how the frame count behaves when loopin
Use `toneFrequency` to adjust the pitch without affecting speed. Values range from 0.01 to 2:
```tsx
+import { Audio } from "@remotion/media";
+
<Audio
src={staticFile("audio.mp3")}
toneFrequency={1.5} // Higher pitch
diff --git a/packages/example/.agents/skills/remotion-markup/sfx.md b/packages/example/.agents/skills/remotion-markup/sfx.md
index ba2dd83b11..9354fe7fbd 100644
--- a/packages/example/.agents/skills/remotion-markup/sfx.md
+++ b/packages/example/.agents/skills/remotion-markup/sfx.md
@@ -5,10 +5,10 @@ metadata:
tags: sfx, sound, effect, audio
---
-To include a sound effect, use the `<Audio>` tag:
+To include a sound effect, use `<Audio>` from `@remotion/media`:
```tsx
-import { Audio } from "@remotion/sfx";
+import { Audio } from "@remotion/media";
<Audio src={"https://remotion.media/whoosh.wav"} />;
```
diff --git a/packages/skills/skills/remotion-markup/audio.md b/packages/skills/skills/remotion-markup/audio.md
index f0ff7187fa..9760336528 100644
--- a/packages/skills/skills/remotion-markup/audio.md
+++ b/packages/skills/skills/remotion-markup/audio.md
@@ -32,6 +32,8 @@ export const MyComposition = () => {
Remote URLs are also supported:
```tsx
+import { Audio } from "@remotion/media";
+
<Audio src="https://remotion.media/audio.mp3" />
```
@@ -43,6 +45,8 @@ Multiple audio tracks can be layered by adding multiple `<Audio>` components.
Use `trimBefore` to skip the beginning of the audio and `durationInFrames` to end it early. Values are in frames.
```tsx
+import { Audio } from "@remotion/media";
+
const { fps } = useVideoConfig();
return (
@@ -78,12 +82,15 @@ The audio will start playing after 1 second.
Set a static volume (0 to 1):
```tsx
+import { Audio } from "@remotion/media";
+
<Audio src={staticFile("audio.mp3")} volume={0.5} />
```
Use `useCurrentFrame()` and `interpolate()` for keyframed volume:
```tsx
+import { Audio } from "@remotion/media";
import { interpolate, useCurrentFrame } from "remotion";
const frame = useCurrentFrame();
@@ -105,6 +112,8 @@ With Studio interactivity enabled, these keyframes can be edited and are shown a
The `volume` prop also accepts a callback for procedural or media-relative volume. The callback frame starts at 0 when the audio begins to play, not at the composition frame:
```tsx
+import { Audio } from "@remotion/media";
+
<Audio
src={staticFile("audio.mp3")}
volume={(mediaFrame) => interpolate(mediaFrame, [0, 30], [0, 1])}
@@ -116,6 +125,8 @@ The `volume` prop also accepts a callback for procedural or media-relative volum
Use `muted` to silence the audio. It can be set dynamically:
```tsx
+import { Audio } from "@remotion/media";
+
const frame = useCurrentFrame();
const { fps } = useVideoConfig();
@@ -132,6 +143,8 @@ return (
Use `playbackRate` to change the playback speed:
```tsx
+import { Audio } from "@remotion/media";
+
// 2x speed
<Audio src={staticFile("audio.mp3")} playbackRate={2} />
// Half speed
@@ -145,6 +158,8 @@ Reverse playback is not supported.
Use `loop` to loop the audio indefinitely:
```tsx
+import { Audio } from "@remotion/media";
+
<Audio src={staticFile("audio.mp3")} loop premountFor={fps} />
```
@@ -156,6 +171,8 @@ Use `loopVolumeCurveBehavior` to control how the frame count behaves when loopin
- `"extend"`: Frame count continues incrementing
```tsx
+import { Audio } from "@remotion/media";
+
<Audio
src={staticFile("audio.mp3")}
loop
@@ -169,6 +186,8 @@ Use `loopVolumeCurveBehavior` to control how the frame count behaves when loopin
Use `toneFrequency` to adjust the pitch without affecting speed. Values range from 0.01 to 2:
```tsx
+import { Audio } from "@remotion/media";
+
<Audio
src={staticFile("audio.mp3")}
toneFrequency={1.5} // Higher pitch
diff --git a/packages/skills/skills/remotion-markup/sequencing.md b/packages/skills/skills/remotion-markup/sequencing.md
index 34b783d2eb..de5fb5a986 100644
--- a/packages/skills/skills/remotion-markup/sequencing.md
+++ b/packages/skills/skills/remotion-markup/sequencing.md
@@ -9,7 +9,7 @@ Prefer timing props directly on built-in interactive components and custom
components made with `Interactive.withSchema({wrapInSequence: true})`.
Avoid wrapping a single timing-capable component in a redundant `<Sequence>`.
Put `name`, `from`, `durationInFrames`, `loop`, `volume`, and `premountFor`
-directly on `<Audio>` whenever their combination gives the intended timing.
+directly on `<Audio>` from `@remotion/media` whenever their combination gives the intended timing.
See [Remotion Interactivity](../remotion-interactivity/SKILL.md) for creating
schema-wrapped components and [connected compositions](connected-compositions.md)
diff --git a/packages/skills/skills/remotion-markup/sfx.md b/packages/skills/skills/remotion-markup/sfx.md
index c46d46c71f..9354fe7fbd 100644
--- a/packages/skills/skills/remotion-markup/sfx.md
+++ b/packages/skills/skills/remotion-markup/sfx.md
@@ -5,7 +5,7 @@ metadata:
tags: sfx, sound, effect, audio
---
-To include a sound effect, use the `<Audio>` tag:
+To include a sound effect, use `<Audio>` from `@remotion/media`:
```tsx
import { Audio } from "@remotion/media";