Static methods

staticfromBase64(base64String:String):AudioBuffer

Creates an AudioBuffer from a Base64-encoded string.

Parameters:

base64String

The Base64-encoded audio data.

Returns:

An AudioBuffer instance with the decoded audio data.

staticfromBytes(bytes:Bytes):AudioBuffer

Creates an AudioBuffer from a Bytes object.

Parameters:

bytes

The Bytes object containing the audio data.

Returns:

An AudioBuffer instance with the decoded audio data.

staticfromFile(path:String):AudioBuffer

Creates an AudioBuffer from a file.

Parameters:

path

The file path to the audio data.

Returns:

An AudioBuffer instance with the audio data loaded from the file.

staticfromFiles(paths:Array<String>):AudioBuffer

Creates an AudioBuffer from an array of file paths.

Parameters:

paths

An array of file paths to search for audio data.

Returns:

An AudioBuffer instance with the audio data loaded from the first valid file found.

staticfromVorbisFile(vorbisFile:VorbisFile):AudioBuffer

Available on Android, Linux, Mac, Windows, iOS

Creates an AudioBuffer from a VorbisFile.

Parameters:

vorbisFile

The VorbisFile object containing the audio data.

Returns:

An AudioBuffer instance with the decoded audio data.

staticfromVorbisFile(vorbisFile:Dynamic):AudioBuffer

Available on Flash, HTML5

Creates an AudioBuffer from a VorbisFile.

Parameters:

vorbisFile

The VorbisFile object containing the audio data.

Returns:

An AudioBuffer instance with the decoded audio data.

staticloadFromFile(path:String):Future<AudioBuffer>

Asynchronously loads an AudioBuffer from a file.

Parameters:

path

The file path to the audio data.

Returns:

A Future that resolves to the loaded AudioBuffer.

staticloadFromFiles(paths:Array<String>):Future<AudioBuffer>

Asynchronously loads an AudioBuffer from multiple files.

Parameters:

paths

An array of file paths to search for audio data.

Returns:

A Future that resolves to the loaded AudioBuffer.

Constructor

new()

Creates a new, empty AudioBuffer instance.

Variables

bitsPerSample:Int

The number of bits per sample in the audio data.

channels:Int

The number of audio channels (e.g., 1 for mono, 2 for stereo).

data:UInt8Array

The raw audio data stored as a UInt8Array.

sampleRate:Int

The sample rate of the audio data, in Hz.

src:Dynamic

The source of the audio data. This can be an Audio, Sound, Howl, or other platform-specific object.

Methods

dispose():Void

Disposes of the resources used by this AudioBuffer, such as unloading any associated audio data.