MusicProperties.Artist | artist property

Applies to Windows and Windows Phone

Gets the artists that contributed to the song.

Syntax

Public Property Artist As String

Property value

Type: String [JavaScript] | System.String [.NET] | Platform::String [C++]

The names of the song's artists.

Remarks

This is how the value returned by the Artist property is determined:

  1. If the AlbumArtist property of the song contains a value, the value of the AlbumArtist property is returned.
  2. If the AlbumArtist property of the song does not contain a value, and the song is marked as part of a compilation, the value "Various Artists" is returned.
  3. Otherwise, the first value from the contributing artists list is returned. The contributing artists list is the value of the System.Music.Artist file property.

If you want to get the album artist, use AlbumArtist instead.

If you want to get the list of all the contributing artists, query the value of the System.Music.Artist file property. The following example shows how to do this.


using Windows.Storage;
using Windows.Storage.FileProperties;
...
    StorageFile musicFile = 
        await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///assets/song.mp3"));
    StorageItemContentProperties fileProperties = musicFile.Properties;
    MusicProperties musicFileProperties =
        await fileProperties.GetMusicPropertiesAsync();
    string[] contributingArtistsKey = { "System.Music.Artist" };
    IDictionary<string, object> contributingArtistsProperty =
        await musicFileProperties.RetrievePropertiesAsync(contributingArtistsKey);
    string[] contributingArtists = contributingArtistsProperty["System.Music.Artist"] as string[];
    foreach (string contributingArtist in contributingArtists)
    {
        // Do something with the name of each contributing artis.
    }


Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]

Namespace

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

Metadata

Windows.winmd

See also

MusicProperties

 

 

Show:
© 2014 Microsoft