Interface AudioBuffer
interface AudioBuffer {
duration: number;
length: number;
numberOfChannels: number;
sampleRate: number;
copyFromChannel(destination: Float32Array, channelNumber: number, bufferOffset?: number): void;
copyToChannel(source: Float32Array, channelNumber: number, bufferOffset?: number): void;
getChannelData(channel: number): Float32Array;
}
duration: number;
length: number;
numberOfChannels: number;
sampleRate: number;
copyFromChannel(destination: Float32Array, channelNumber: number, bufferOffset?: number): void;
copyToChannel(source: Float32Array, channelNumber: number, bufferOffset?: number): void;
getChannelData(channel: number): Float32Array;
}
Index
Properties
Methods
Properties
Readonly
duration
duration: number
Readonly
length
length: number
Readonly
numberOfChannels
numberOfChannels : number
Readonly
sampleRate
sampleRate : number
Methods
copyFromChannel
- copy
From (destination, channelNumber, bufferOffset?): voidChannel Parameters
- destination: Float32Array
- channelNumber: number
Optional
bufferOffset: number
Returns void
copyToChannel
- copy
To (source, channelNumber, bufferOffset?): voidChannel Parameters
- source: Float32Array
- channelNumber: number
Optional
bufferOffset: number
Returns void
getChannelData
- get
Channel (channel): Float32ArrayData Parameters
- channel: number
Returns Float32Array
A short audio asset residing in memory, created from an audio file using the AudioContext.decodeAudioData() method, or from raw data using AudioContext.createBuffer(). Once put into an AudioBuffer, the audio can then be played by being passed into an AudioBufferSourceNode.
MDN Reference