AudioBuffer - basic audio data container class with planar float32 data layout.
Useful instead of Buffer in audio streams, audio components, workers, nodejs, environments without web-audio-api. Enables various audio-buffer utils outside of audio contexts or browsers.
Implementation is compatible with Web Audio API AudioBuffer, can be used as ponyfill.
Create audio buffer from options
.
options.length
— number of samples, minimum is 1.options.sampleRate
— sample rate from 3000..768000 range.options.numberOfChannels
(optional) — default number of channels is 1.
Duration of the underlying audio data, in seconds.
Number of samples per channel.
Default sample rate is 44100.
Default number of channels is 1.
Get array containing the data for the channel (not copied).
Place data from channel to destination Float32Array.
Place data from source Float32Array to the channel.