Capítulo 230 de 988

Chapter 230: Audio Sample Rate

Core Idea

Match the sample rate of your audio input to the output sample rate to get the best audio quality.

Key Concepts

  • Default behavior
  • Overriding the sample rate<AvailableFrom v="4.0.448" />
  • Via renderMedia()
  • Via renderMediaOnWeb()
  • Via CLI flag
  • Via config file
  • Via the Studio render dialog
  • Matching the sample rate of your source audio

Code Examples

// @module: es2022
// @target: es2017

const bundled = await bundle({entryPoint: './src/index.ts'});

const composition = await selectComposition({
  serveUrl: bundled,
  id: 'MyComp',
});

await renderMedia({
  composition,
  serveUrl: bundled,
  codec: 'h264',
  sampleRate: 44100,
});
  • What it demonstrates: Usage pattern for Audio Sample Rate from the official docs.

Key Takeaways

  1. Understand default behavior when working with Audio Sample Rate.
  2. Understand overriding the sample rate<availablefrom v="4.0.448" /> when working with Audio Sample Rate.
  3. Understand via rendermedia() when working with Audio Sample Rate.
  4. Understand via rendermediaonweb() when working with Audio Sample Rate.
  5. Understand via cli flag when working with Audio Sample Rate.

Connects To

  • Animatedimage: related page in the Assets & Media section.
  • Delaying: related page in the Assets & Media section.
  • Exporting: related page in the Assets & Media section.