Description

A file track provider of the Licensed Sounds from Asset LIbrary.

Example

//@input Asset.AudioTrackAsset audioTrack

var control = script.audioTrack.control;
var sampleRate = control.sampleRate;
var audioBuffer = new Float32Array(control.maxFrameSize);
control.loops = -1;


script.createEvent("UpdateEvent").bind(function (eventData) {
var readSize = eventData.getDeltaTime() * sampleRate;
control.getAudioBuffer(audioBuffer, readSize);
});
interface FileLicensedSoundProvider {
    duration: number;
    loops: number;
    maxFrameSize: number;
    sampleRate: number;
    getAudioBuffer(audioBuffer, readSize): vec3;
    getAudioFrame(audioFrame): vec3;
    getLoadStatus(): LoadStatus;
    getTypeName(): string;
    isOfType(type): boolean;
    isSame(other): boolean;
}

Hierarchy (view full)

Properties

duration: number

Description

The duration of the AudioTrackAsset in seconds.

loops: number

Description

Loop count, if -1 is provided, the audio track will loop forever.

maxFrameSize: number

Description

The maximum frame size of the audio track asset.

sampleRate: number

Description

Sample rate (samples per second) of the audio track asset.

Methods

  • Parameters

    • audioBuffer: Float32Array
    • readSize: number

    Returns vec3

    Description

    Writes readSize samples into the passed in audioBuffer Float32Array.

  • Parameters

    • audioFrame: Float32Array

    Returns vec3

    Description

    Writes current audio frame to the passed in Float32Array and returns the frame shape.

  • Parameters

    • type: string

    Returns boolean

    Description

    Returns true if the object matches or derives from the passed in type.

  • Parameters

    Returns boolean

    Description

    Returns true if this object is the same as other. Useful for checking if two references point to the same thing.

Generated using TypeDoc