The AudioBufferSourceNode interface represents an audio source consisting of in-memory audio data, stored in an AudioBuffer. It is an AudioNode that acts as an audio source.

Documentation AudioBufferSourceNode by Mozilla Contributors, licensed under CC-BY-SA 2.5.

See:

Variables

buffer:AudioBuffer

Is an AudioBuffer that defines the audio asset to be played, or when set to the value null, defines a single channel of silence. 

read onlydetune:AudioParam

Is a AudioParam representing detuning of oscillation in cents. Its default value is 0.

loop:Bool

Is a Boolean attribute indicating if the audio asset must be replayed when the end of the AudioBuffer is reached. Its default value is false.

loopEnd:Float

Is a double value indicating, in seconds, where in the AudioBuffer the replay of the play must stop (and eventually loop again). Its default value is 0.

loopStart:Float

Is a double value indicating, in seconds, where in the AudioBuffer the restart of the play must happen. Its default value is 0.

onended:Function

Is an EventHandler containing the callback associated with the ended_(Web_Audio) event.

read onlyplaybackRate:AudioParam

Is an a-rate AudioParam that defines the speed factor at which the audio asset will be played. Since no pitch correction is applied on the output, this can be used to change the pitch of the sample.

Methods

start (when:Float = 0.0, grainOffset:Float = 0.0, ?grainDuration:Float):Void

Throws:

null

DOMError

stop (when:Float = 0.0):Void

Throws:

null

DOMError

Inherited Variables

Defined by AudioNode

channelCount:Int

Represents an integer used to determine how many channels are used when up-mixing and down-mixing connections to any inputs to the node. Its usage and precise definition depend on the value of AudioNode.channelCountMode.

channelCountMode:ChannelCountMode

Represents an enumerated value describing the way channels must be matched between the node's inputs and outputs.

channelInterpretation:ChannelInterpretation

Represents an enumerated value describing the meaning of the channels. This interpretation will define how audio up-mixing and down-mixing will happen.

The possible values are "speakers" or "discrete".

read onlycontext:AudioContext

Returns the associated AudioContext, that is the object representing the processing graph the node is participating in.

read onlynumberOfInputs:Int

Returns the number of inputs feeding the node. Source nodes are defined as nodes having a numberOfInputs property with a value of 0.

read onlynumberOfOutputs:Int

Returns the number of outputs coming out of the node. Destination nodes — like AudioDestinationNode — have a value of 0 for this attribute.

Inherited Methods

Defined by AudioNode

connect (destination:AudioParam, output:Int = 0):Void

connect (destination:AudioNode, output:Int = 0, input:Int = 0):AudioNode

Throws:

null

DOMError

disconnect (output:Int = 0):Void

Throws:

null

DOMError

Defined by EventTarget

addEventListener (type:String, listener:Function, capture:Bool = false):Void

addEventListener (type:String, listener:EventListener, capture:Bool = false, ?wantsUntrusted:Bool):Void

Throws:

null

DOMError

dispatchEvent (event:Event):Bool

Throws:

null

DOMError

removeEventListener (type:String, listener:Function, capture:Bool = false):Void

removeEventListener (type:String, listener:EventListener, capture:Bool = false):Void

Throws:

null

DOMError