MusicProperties class

MusicProperties class

Provides access to the music-related properties of an item (like a file or folder).

Syntax


Public NotInheritable Class MusicProperties
    Implements IStorageItemExtraProperties

Members

The MusicProperties class has these types of members:

Methods

The MusicProperties class has these methods. With C#, Visual Basic, and C++, it also inherits methods from the Object class.

MethodDescription
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.

 

Properties

The MusicProperties class has these properties.

PropertyAccess typeDescription

Album

Read/write

Gets or sets the name of the album that contains the song.

AlbumArtist

Read/write

Gets or sets the name of the album artist of the song.

Artist

Read/write

Gets the artists that contributed to the song.

Bitrate

Read-only

Gets the bit rate of the song file.

Composers

Read-only

Gets the composers of the song.

Conductors

Read-only

Gets the conductors of the song.

Duration

Read-only

Gets the duration of the song in milliseconds.

Genre

Read-only

Gets the names of music genres that the song belongs to.

Producers

Read-only

Gets the producers of the song.

Publisher

Read/write

Gets or sets the publisher of the song.

Rating

Read/write

Gets or sets the rating associated with a music file.

Subtitle

Read/write

Gets or sets the subtitle of the song.

Title

Read/write

Gets or sets the title of the song

TrackNumber

Read/write

Gets or sets the track number of the song on the song's album.

Writers

Read-only

Gets the songwriters.

Year

Read/write

Gets or sets the year that the song was released.

 

Remarks

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:

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.

Examples

This example demonstrates how to retrieve properties of a file, including music properties like Album and Rating.

No code example is currently available or this language may not be supported.

After GetMusicPropertiesAsync completes, musicProperties gets a MusicProperties object.

In the example, file contains a StorageFile that represents the file to retrieve properties for.

Requirements (Windows 10 device family)

Device family

Universal, introduced version 10.0.10240.0

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

Windows.Storage.FileProperties
Windows::Storage::FileProperties [C++]

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

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

Namespace

Windows.Storage.FileProperties
Windows::Storage::FileProperties [C++]

Metadata

Windows.winmd

Attributes

[Version(0x06020000)]

See also

Object
IStorageItemExtraProperties
StorageItemContentProperties.getMusicPropertiesAsync method
Windows.Storage.BulkAccess.fileInformation.musicProperties property
Windows.Storage.BulkAccess.folderInformation.musicProperties property
Windows.Storage.BulkAccess.IStorageItemInformation.MusicProperties property

 

 

Show:
© 2016 Microsoft