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.

interface AudioBuffer {
    duration: number;
    length: number;
    numberOfChannels: number;
    sampleRate: number;
    copyFromChannel(destination, channelNumber, bufferOffset?): void;
    copyToChannel(source, channelNumber, bufferOffset?): void;
    getChannelData(channel): Float32Array;
}

Properties

duration: number
length: number
numberOfChannels: number
sampleRate: number

Methods

  • Parameters

    • destination: Float32Array
    • channelNumber: number
    • Optional bufferOffset: number

    Returns void

  • Parameters

    • source: Float32Array
    • channelNumber: number
    • Optional bufferOffset: number

    Returns void

  • Parameters

    • channel: number

    Returns Float32Array