AudioBuffer class
The interface represents 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.
Objects of these types are designed to hold small audio
snippets, typically less than 45 s. For longer sounds, objects
implementing the MediaElementAudioSourceNode are more suitable.
The buffer contains data in the following format: non-interleaved
IEEE754 32-bit linear PCM with a nominal range between -1
and
+1
, that is, a 32-bit floating point buffer, with each sample
between -1.0 and 1.0. If the has multiple channels, they are
stored in separate buffers.
- Available extensions
- Annotations
-
- @JS()
- @staticInterop
Constructors
- AudioBuffer(AudioBufferOptions options)
-
factory
Properties
- duration → double
-
Available on AudioBuffer, provided by the PropsAudioBuffer extension
no setter - hashCode → int
-
The hash code for this object.
no setterinherited
- length → int
-
Available on AudioBuffer, provided by the PropsAudioBuffer extension
no setter - numberOfChannels → int
-
Available on AudioBuffer, provided by the PropsAudioBuffer extension
no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sampleRate → double
-
Available on AudioBuffer, provided by the PropsAudioBuffer extension
no setter
Methods
-
copyFromChannel(
Float32List destination, int channelNumber, [int? bufferOffset = 0]) → void -
Available on AudioBuffer, provided by the PropsAudioBuffer extension
-
copyToChannel(
Float32List source, int channelNumber, [int? bufferOffset = 0]) → void -
Available on AudioBuffer, provided by the PropsAudioBuffer extension
-
getChannelData(
int channel) → Float32List -
Available on AudioBuffer, provided by the PropsAudioBuffer extension
-
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