AudioBuffer ponyfill. Provides useful constructor for Web-Audio API AudioBuffer, if available, otherwise provides optimal AudioBuffer implementation for node/browsers. Useful instead of Buffer in audio streams (see @audiojs components).
var AudioBuffer =//Create audio buffer from a data source or of a length.//Data is interpreted as a planar sequence of float32 samples.//It can be Array, TypedArray, ArrayBuffer, Buffer, AudioBuffer, DataView, NDArray etc.var buffer = channels = 2 data|length sampleRate = 44100//Duration of the underlying audio data, in secondsbufferduration//Number of samples per channelbufferlength//Default sample rate is 44100buffersampleRate//Default number of channels is 2buffernumberOfChannels//Get array containing the data for the channel (not copied)buffer//Place data from channel to destination Float32Arraybuffer//Place data from source Float32Array to the channelbuffer//Some special properties, it’s unlikely you will ever need them.//Type of array for data. Float64Array is faster for modern node/browsers.AudioBufferFloatArray = Float64Array//In browser, you can set custom audio context (online/offline).AudioBuffercontext =//Whether WebAudioAPI AudioBuffer should be created, if avail, instead of polyfilled structureAudioBufferisWAA = true