Skip to main content
rule CX Codex

audio — Claude Code rule: sound in Remotion

Rule for handling sound in Remotion: import audio files, trim, adjust volume and playback speed, shift pitch. Requires the @remotion/media package.

no license ★ 849 updated 2026-01-24

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/rules/audio.md
Open on GitHub

What audio does

This rule explains how to add and edit audio tracks in Remotion video compositions. It covers importing local and remote audio files via the <Audio> component, trimming by frame count (trimBefore, trimAfter), delaying playback with <Sequence>, static and dynamic volume control through callbacks, muting, playback speed adjustment (playbackRate), looping (loop) with frame count behavior options, and pitch shifting (toneFrequency ranging 0.01 to 2).

Install the @remotion/media package first using npx remotion add @remotion/media (or the equivalent for bun, yarn, pnpm). Pitch shifting only renders on the server; the effect will not appear in Studio preview or the <Player> component. Reverse playback is not available.

What it helps with

  • embed an audio file into a Remotion video composition
  • trim audio start and end points by frame count
  • set static or animated volume with transitions
  • create looping audio with controllable frame counting behavior
  • adjust pitch independently of playback speed

Example prompts for the agent

  • Add audio from background.mp3 throughout the entire composition
  • Trim the first 2 seconds and end at the 10-second mark while fading volume from 0 to 1
  • Loop background music and raise its pitch to 1.5 during server-side rendering

How to install audio

Manually: put the files in place

.claude/rules/audio.md

The paths frontmatter field limits the files

Step by step, with commands for each platform: AGENTS.md vs CLAUDE.md: what they are and which one to use

Questions about audio

How do I install the audio rule in Claude Code?

Copy the audio.md file into your project's .claude/rules/ directory. Claude Code will then apply the rule automatically when you work with audio in Remotion.

What does the audio rule cover?

It provides code examples and guidance on importing audio, trimming clips, controlling volume, adjusting playback speed, and applying effects like pitch shifting and looping to audio tracks in Remotion.

Why doesn't pitch shifting work in the preview?

The toneFrequency property only takes effect during server-side video export, not in Studio preview or the <Player> component. Test your pitch changes by rendering the video to file.

Similar IDE rules

All IDE rules for Frontend and UI →

From the same set33

The whole set →
videos videos — a rule for embedding video in Remotion compositions with trimming, volume control, playback speed, looping and pitch adjustment. Lets you work with video files in animations without repeating boilerplate code. CX Codex +1 ★ 849repo stars display-captions display-captions — a rule that walks through drawing captions in Remotion: grouping them into TikTok-style pages and highlighting whichever word is being spoken. CX Codex +1 ★ 849repo stars compositions Sets guidelines for structuring Remotion compositions, still frames, folders, and dynamic metadata in src/Root.tsx. CX Codex +1 ★ 849repo stars transitions This rule guides Claude Code in adding fullscreen transitions between Remotion scenes or clips. Use it when building a composition from multiple scenes. CX Codex +1 ★ 849repo stars gifs gifs is a Claude Code rule for synchronizing GIF, APNG, AVIF, and WebP animations with Remotion composition timelines. CX Codex +1 ★ 849repo stars timing This rule covers interpolation, easing, and spring motion in Remotion. Use it when animations need frame-based timing and controlled movement. CX Codex +1 ★ 849repo stars mcp-client The mcp-client skill links Claude Code to any MCP server and pulls in tool schemas on demand instead of loading them all at once. CX Codex +1 ★ 849repo stars extract-frames extract-frames guides Claude Code in extracting video frames at specific timestamps using Mediabunny and rendering them to canvas. CX Codex +1 ★ 849repo stars

Project sponsors

Companies that keep this analytics open