开发者

How do I get an .mp3's Album/Artist data?

I am trying to get the Album data and Artist data from a .mp3 file. Here is my code I am trying to use, but it always returns blank:

miniMusic.currentMedia.getItemInfo("Artist")

When I use that property for my application in the way of:

Label1.Text = miniMusic.currentMedia.getItemInfo("Artist")

It returns blank. I made sure it was the actual returning data that was blank by doing:

Label1.Text = "Artist: " + miniMusic.currentMedia.getItemInfo("Artist")

To see the label's text only say "Artist: " when I invoked that code.

How can I obtain the song file's data and display it in my application?

The only data I was able to display was the title information from the "currentMedia.getItemInfo("Title")

I made my own .mp3 file in Audacity and made sure 开发者_运维问答to include the artist name (John) and album title (Laffin' on sunshine (Not a real album!) and my application still cannot find this data. Am I doing it incorrectly or is the media control unable to find this data?


You might want to consider reading the ID3 tags independently from the media control.

This SO query yields choices of free libraries that will do the grunt work for you. Here are two.

  • Taglib sharp (C#)
  • UltraID3Lib (VB.NET)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜