Start from base library version 2.19.0. Please remaining backward compatible.
The AudioBuffer interface represents a short audio resource stored in memory, using theWebAudioContext.decodeAudioDataMethod from an audio file, or using the AudioContext.createBufferBuild from raw data. Once you put the audio into the AudioBuffer, you can pass it to a Audio Buffer Source Node plays.
# number sampleRate
Sampling rate of PCM data stored in the cache in sample/s)
# number length
Returns the sample frame rate of PCM data stored in the buffer
# number duration
Length of time in seconds to return PCM data stored in the cache
# number numberOfChannels
Number of channels of PCM data stored in the cache
Returns a Float32 Array contains PCM data with channels, defined by channel parameters (0 for first channel)
Copies from the specified channel of AudioBuffer to the array terminal.
Specific channel from the specified array copy sample to audioBuffer