Skip to content

Allow a toneFrequency prop to be passed to <Audio> (Change pitch of Audio) #2932

@JonnyBurger

Description

@JonnyBurger

Allow to change the pitch (technically named "tone frequency") of an audio.

Desired API

<Audio toneFrequence={0.9} />

When calling registerRenderAsset(), this information gets passed and when it arrives at preprocessAudioTrack, then a FFmpeg filter will be applied.

For example <Audio toneFrequency={0.9} /> could result in a asetrate=44100*0.9,aresample=44100,atempo=1/0.9 filter being applied to the audio.

Filter taken from this answer: https://stackoverflow.com/questions/53374590/ffmpeg-change-tone-frequency-keep-length-pitch-audio

Acceptance criteria

  • Should implement a way to change the pitch of the audio during rendering.
  • Should prevent changing the pitch over time (we do not need to support this right now)
  • Add it to the <Audio> docs
  • Mention limitations in docs: Must have static value per audio (no change over time), will only work during rendering and not in preview
  • Implement min / max values that seem rational to your judgement

Bounty

💎 This issue is part of Hacktoberfest and has a bounty on it!

🎃 Hacktoberfest rules

  • You can only work on 1 issue at a time.
  • Only 1 person can work on the same issue.
  • We explicitly assign a developer. Don’t work on an issue if we do not assign you.
  • First-time contributors will get preferential treatment.
  • You must set up the Remotion repository locally and test your changes. Contributing to Remotion | Remotion | Make videos programmatically in React
  • Your PR must fulfill the acceptance criteria.
  • If you use AI, you must verify that the output is correct.
  • All tests (functionality and formatting) must pass.

Issue already taken? Find more issues under https://remotion.dev/bounties

/bounty 200

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions