Skip to main content

LensStudio:AssetLibrary.MusicAsset

Class

Handle for a music asset from the Asset Library.

Index

Example

// MusicAsset represents a single licensed music track returned by MusicListService.
// It is read from a MusicListResponse — never constructed directly.
const provider = this.pluginSystem.findInterface(
IAssetLibraryProvider.interfaceId
) as import('LensStudio:AssetLibrary').IAssetLibraryProvider;

const envSetting = new EnvironmentSetting();
envSetting.environment = Environment.Production;
envSetting.space = Space.Public;

const filter = new AssetFilter();
filter.searchText = 'chill';

const response = await provider.musicService.fetchAsync(
new AssetListRequest(envSetting, filter)
);

if (response.ok && response.data) {
for (const track of response.data.musicAssets.slice(0, 3)) {
console.log(track.assetName, '—', track.artistName,
'(explicit:', track.isExplicit + ')');
console.log(' id:', track.assetId, 'platforms:', track.platforms.length);
}
}

Properties

artistName

readonly artistName: string

Name of the artist who created the music track.


assetId

readonly assetId: string

Unique identifier for this asset in the Asset Library.


assetName

readonly assetName: string

Display name of the music asset.


assetType

readonly assetType: AssetType

Type category of the asset, as an AssetType enum value.


complexity

readonly complexity: number

Complexity rating or level associated with this asset.


creator?

readonly optional creator?: Creator

Creator or rights holder of the asset.


description

readonly description: string

Short description of the music asset.


documentationUrl

readonly documentationUrl: string

URL pointing to documentation or more information about this asset.


fullDescription

readonly fullDescription: string

Extended description of the music asset with additional detail.


isExplicit

readonly isExplicit: boolean

Indicates whether the track contains explicit content.


maxLsVersion

readonly maxLsVersion: Version

Maximum Lens Studio version this asset is compatible with.


platforms

readonly platforms: Platform[]

List of platforms on which this asset is available.


previews

readonly previews: Resource[]

Preview resources available for this music asset.


resources

readonly resources: Resource[]

Downloadable or importable resources associated with this asset.


subcategories

readonly subcategories: Subcategory[]

Subcategory tags used to classify this asset within the library.