C# 我无法在C中使用WMPLib获得艺术家和专辑的名称#

C# 我无法在C中使用WMPLib获得艺术家和专辑的名称#,c#,wmp,wmplib,C#,Wmp,Wmplib,我正在尝试用WMPLib制作一个C#音乐播放器。以下是我所拥有的: WMPLib.WindowsMediaPlayer song = new WMPLib.WindowsMediaPlayer(); song.URL = file; //the path to a mp3 file song.controls.stop(); Console.WriteLine(song.currentMedia.getItemInfo("Title")); Console.WriteLine(song.cur

我正在尝试用WMPLib制作一个C#音乐播放器。以下是我所拥有的:

WMPLib.WindowsMediaPlayer song = new WMPLib.WindowsMediaPlayer();
song.URL = file;  //the path to a mp3 file
song.controls.stop();
Console.WriteLine(song.currentMedia.getItemInfo("Title"));
Console.WriteLine(song.currentMedia.getItemInfo("Artist"));
Console.WriteLine(song.currentMedia.getItemInfo("Album"));

只有“song.currentMedia.getItemInfo(“Title”)”有效(它返回标题)。我对艺术家和专辑做了什么错事,他们返回了“”(什么都没有)

我解决了!我得等一会儿,才能从磁盘加载歌曲。只有在歌曲加载后,才能使用唱片集和艺术家等信息

这很有帮助: