AudioBufferSourceNode class


AudioBufferSourceNode


This interface represents an audio source from an in-memory audio asset in an AudioBuffer. It is useful for playing audio assets which require a high degree of scheduling flexibility and accuracy. If sample-accurate playback of network- or disk-backed assets is required, an implementer should use AudioWorkletNode to implement playback.

The start() method is used to schedule when sound playback will happen. The start() method may not be issued multiple times. The playback will stop automatically when the buffer’s audio data has been completely played (if the loop attribute is false), or when the stop() method has been called and the specified time has been reached. Please see more details in the start() and stop() descriptions.

  • numberOfInputs 0
  • numberOfOutputs 1
  • channelCount 2
  • channelCountMode "max"
  • channelInterpretation "speakers"
  • tail-time No

The number of channels of the output equals the number of channels of the AudioBuffer assigned to the buffer attribute, or is one channel of silence if buffer is null.

In addition, if the buffer has more than one channel, then the AudioBufferSourceNode output must change to a single channel of silence at the beginning of a render quantum after the time at which any one of the following conditions holds:

  • the end of the buffer has been reached;
  • the duration has been reached;
  • the stop time has been reached.

A playhead position for an AudioBufferSourceNode is defined as any quantity representing a time offset in seconds, relative to the time coordinate of the first sample frame in the buffer. Such values are to be considered independently from the node’s playbackRate and detune parameters. In general, playhead positions may be subsample-accurate and need not refer to exact sample frame positions. They may assume valid values between 0 and the duration of the buffer.

The playbackRate and detune attributes form a compound parameter. They are used together to determine a computedPlaybackRate value:

computedPlaybackRate(t) = playbackRate(t) * pow(2, detune(t) / 1200) The nominal range for this compound parameter is (−∞,∞).

AudioBufferSourceNodes are created with an internal boolean slot buffer set, initially set to false.

Inheritance

Constructors

AudioBufferSourceNode()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited