Preparing search index...

    Licensed audio track asset with metadata and runtime source paths.

        const model = this.pluginSystem.findInterface(Editor.Model.IModel) as Editor.Model.IModel;
    const scene = model.project.scene;

    // Find LicensedAudioTrack assets and assign to an AudioComponent
    const tracks = model.project.assetManager.assets.filter(
    a => a.isOfType('LicensedAudioTrack')
    ) as Editor.Assets.LicensedAudioTrack[];

    if (tracks.length > 0) {
    const track = tracks[0];
    console.log(`Track: ${track.trackName}, artist: ${track.artistName}, bundled: ${track.bundled}`);

    // Create a scene object with an AudioComponent and assign the track
    const obj = scene.createSceneObject('MusicPlayer');
    const audio = obj.addComponent('AudioComponent');
    audio.audioTrack = track;
    audio.enableAutoplayLoop = true;
    }

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    artistName: string

    Name of the track's artist.

    bundled: boolean

    Whether the track is bundled with the project.

    cacheFile: Path

    Path to the cached asset file.

    Import metadata for the asset.

    id: Uuid

    The unique id of the entity.

    meta: Meta

    Metadata associated with this entity, providing access to its unique identifier and other descriptive properties.

    name: string

    The name of the asset.

    runtimeSourceBeatsPath: Path

    Runtime path to the track's beats data.

    runtimeSourceLyricsPath: Path

    Runtime path to the track's lyrics data.

    runtimeSourcePath: Path

    Runtime path to the track's audio file.

    trackId: string
    trackName: string
    type: string

    The entity's type.

    Methods

    • Returns true if the object is of the specified type.

      Parameters

      • type: string

      Returns boolean