Chapter 725: getPartialAudioData()
Core Idea
:::warning We are phasing out Remotion WebCodecs and are moving to Mediabunny!
Key Concepts
- API
- src
- fromSeconds
- toSeconds
- channelIndex
- signal
- Return value
- Notes
Code Examples
const audioData = await getPartialAudioData({
src: 'https://remotion.media/audio.wav',
fromSeconds: 10,
toSeconds: 20,
channelIndex: 0, // Left channel for stereo audio
signal: new AbortController().signal,
});
console.log('Audio samples:', audioData.length);
console.log('First sample value:', audioData[0]);
- What it demonstrates: Usage pattern for getPartialAudioData() from the official docs.
Key Takeaways
- Understand api when working with getPartialAudioData().
- Understand src when working with getPartialAudioData().
- Understand fromseconds when working with getPartialAudioData().
- Understand toseconds when working with getPartialAudioData().
- Understand channelindex when working with getPartialAudioData().
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.