An audio data object contains information about audio samples or streams, ready to be used. AudioData objects typically come from the app.assets.audio API or app.audio.module.data_from_path, since the implemenation details of decoding audio and streams are module level implementation details. This is stored by AudioSource and AssetAudio objects for example.

Constructor

inlinenew(app:Clay, options:AudioDataOptions)

Variables

app:Clay

Access to the snow runtime

@:value("AudioData")id:String = "AudioData"

The associated id for the data

samples:Uint8Array

The sample data bytes, if any (streams don't populate this)

@:value(44100)rate:Int = 44100

The sample rate in samples per second

@:value(0)length:Int = 0

The PCM length in samples

@:value(0)duration:Float = 0

The duration in seconds of the PCM buffer

@:value(1)channels:Int = 1

The number of channels for this data

@:value(16)bitsPerSample:Int = 16

The number of bits per sample for this data

@:value(UNKNOWN)format:AudioFormat = UNKNOWN

The audio format type of the sample data

@:value(false)isStream:Bool = false

Whether or not this data is a stream of samples

@:value(false)destroyed:Bool = false

Whether or not this data has been destroyed

Methods