LensStudio:AssetLibrary.MusicAsset
ClassHandle for a music asset from the Asset Library.
Index
Properties
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
readonlyartistName:string
Name of the artist who created the music track.
assetId
readonlyassetId:string
Unique identifier for this asset in the Asset Library.
assetName
readonlyassetName:string
Display name of the music asset.
assetType
readonlyassetType:AssetType
Type category of the asset, as an AssetType enum value.
complexity
readonlycomplexity:number
Complexity rating or level associated with this asset.
creator?
readonlyoptionalcreator?:Creator
Creator or rights holder of the asset.
description
readonlydescription:string
Short description of the music asset.
documentationUrl
readonlydocumentationUrl:string
URL pointing to documentation or more information about this asset.
fullDescription
readonlyfullDescription:string
Extended description of the music asset with additional detail.
isExplicit
readonlyisExplicit:boolean
Indicates whether the track contains explicit content.
maxLsVersion
readonlymaxLsVersion:Version
Maximum Lens Studio version this asset is compatible with.
platforms
readonlyplatforms:Platform[]
List of platforms on which this asset is available.
previews
readonlypreviews:Resource[]
Preview resources available for this music asset.
resources
readonlyresources:Resource[]
Downloadable or importable resources associated with this asset.
subcategories
readonlysubcategories:Subcategory[]
Subcategory tags used to classify this asset within the library.