Provides access to the music-related properties of an item (like a file or folder).
Public NotInheritable Class MusicProperties Implements IStorageItemExtraProperties
The MusicProperties class has these types of members:
The MusicProperties class has these methods. With C#, Visual Basic, and C++, it also inherits methods from the Object class.
|RetrievePropertiesAsync||Retrieves the specified properties associated with the item.|
|SavePropertiesAsync()||Saves all properties associated with the item.|
|SavePropertiesAsync(IIterable(IKeyValuePair))||Saves the specified properties and values associated with the item.|
The MusicProperties class has these properties.
|Read/write||Gets or sets the name of the album that contains the song.|
|Read/write||Gets or sets the name of the album artist of the song.|
|Read/write||Gets the artists that contributed to the song or sets the album artist.|
|Read-only||Gets the bit rate of the song file.|
|Read-only||Gets the composers of the song.|
|Read-only||Gets the conductors of the song.|
|Read-only||Gets the duration of the song in milliseconds.|
|Read-only||Gets the names of music genres that the song belongs to.|
|Read-only||Gets the producers of the song.|
|Read/write||Gets or sets the publisher of the song.|
|Read/write||Gets or sets the rating associated with a music file.|
|Read/write||Gets or sets the subtitle of the song.|
|Read/write||Gets or sets the title of the song|
|Read/write||Gets or sets the track number of the song on the song's album.|
|Read-only||Gets the songwriters.|
|Read/write||Gets or sets the year that the song was released.|
You can access a MusicProperties object asynchronously using the getMusicPropertiesAsync method from the Properties property of an item (like a file of folder), or synchronously using the MusicProperties property if it is available.
You can get a musicProperties object using any of the following methods and properties:
- StorageItemContentProperties.getMusicPropertiesAsync method, which can be accessed using the Properties property, if it is available.
- FileInformation.musicProperties property
- FolderInformation.musicProperties property
Note Properties that are get or set using a property handler that is defined by another app (like Microsoft Word) may not be accessible. Instead, you can try to get these properties using a file query that is backed by the system index. For more information, see QueryOptions.
For more code samples about accessing properties, see the File access sample.
After GetMusicPropertiesAsync completes,
musicProperties gets a MusicProperties object.
In the example,
file contains a StorageFile that represents the file to retrieve properties for.
Minimum supported client
|Windows 8 [Windows Store apps only]|
Minimum supported server
|Windows Server 2012 [Windows Store apps only]|
Minimum supported phone
|Windows Phone 8|
- StorageItemContentProperties.getMusicPropertiesAsync method
- Windows.Storage.BulkAccess.fileInformation.musicProperties property
- Windows.Storage.BulkAccess.folderInformation.musicProperties property
- Windows.Storage.BulkAccess.IStorageItemInformation.MusicProperties property