Capítulo 710 de 988

Chapter 710: convertAudioData()

Core Idea

:::warning We are phasing out Remotion WebCodecs and are moving to Mediabunny!

Key Concepts

  • Behavior
  • API
  • audioData
  • newSampleRate?
  • newFormat?
  • See also

Code Examples

const audioData = new AudioData({
  data: new Int32Array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]),
  format: 's32',
  numberOfChannels: 1,
  numberOfFrames: 10,
  sampleRate: 44100,
  timestamp: 0,
});

const newAudioData = convertAudioData({audioData, newSampleRate: 22050});

/*
{
  data: [0, 2, 4, 6, 8],
  format: 's32',
  numberOfChannels: 1,
  numberOfFrames: 5,
  sampleRate: 22050,
  timestamp: 0,
}
*/
  • What it demonstrates: Usage pattern for convertAudioData() from the official docs.

Key Takeaways

  1. Understand behavior when working with convertAudioData().
  2. Understand api when working with convertAudioData().
  3. Understand audiodata when working with convertAudioData().
  4. Understand newsamplerate? when working with convertAudioData().
  5. Understand newformat? when working with convertAudioData().

Connects To

  • Buffer Writer: related page in the WebCodecs (@remotion/webcodecs) section.
  • can Copy Audio Track: related page in the WebCodecs (@remotion/webcodecs) section.
  • can Copy Video Track: related page in the WebCodecs (@remotion/webcodecs) section.