ffmpeg-audiobuffer-stream
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

ffmpeg-audiobuffer-stream

Decode an audio file (using fluent-ffmpeg) to make an object stream where each chunk is an AudioBuffer.

Install

You may first need to install ffmpeg https://ffmpeg.org.

Then run, npm i ffmpeg-audiobuffer-stream

Usage

import {decode} from 'ffmpeg-audiobuffer-stream'

const sampleRate = 44100 // Hz
const numberOfChannels = 2 // stereo

let audioStream = decode('path/to/my/audio/file.mp3', sampleRate, numberOfChannels)

audioStream.on('data', chunk => {
  // Chunk is a WebAudioAPI AudioBuffer object containing a small frame of audio.
})

// Alternatively, pipe to a writable AudioBuffer object-stream.
audioStream.pipe(myAudioWritableStream)

Readme

Keywords

none

Package Sidebar

Install

npm i ffmpeg-audiobuffer-stream

Weekly Downloads

3

Version

1.0.0

License

ISC

Unpacked Size

22.8 kB

Total Files

9

Last publish

Collaborators

  • joelplow