简体   繁体   English

如何更新的Windows Media Player专辑封面编程在C#

[英]How to update Windows Media Player Album Art programatically in C#

I am writing an application to help with recording Vinyl albums to digital format, for use in Windows Media Player and Media Centre. 我正在编写一个应用程序,以帮助将乙烯基唱片集录制为数字格式,以便在Windows Media Player和Media Center中使用。

I have the recording and track splitting part done, including saving the track information with taglib. 我已经完成了录音和音轨拆分部分,包括使用taglib保存音轨信息。

I now need to add album art in a way that can be picked up by Media Player. 现在,我需要以一种可以被Media Player拾取的方式添加专辑封面。

I notice Media Player saves the album art in 2 hidden/system files in the album folder, which include a GUID in the file name. 我注意到Media Player将专辑封面保存在专辑文件夹中的2个隐藏/系统文件中,该文件名中包含GUID。

Is there some way I could work out the correct file name to use, and save my album art to the file? 有什么方法可以算出要使用的正确文件名,并将专辑封面保存到文件中? Or is there an interface to the Media Player library, so I can tell it what the album art is? 还是有Media Player库的接口,所以我可以告诉它专辑封面是什么?

Windows Media Player (and every other player which displays album covers) uses tags to retrieve the pictures. Windows Media Player(以及显示专辑封面的所有其他播放器)都使用标签来检索图片。 The pictures are embedded within the music files in tags. 这些图片嵌入标签的音乐文件中。 The hidden images are just cache for the thumbnails to be displayed in the player. 隐藏的图片只是缓存要显示在播放器中的缩略图。 Also, other info like Title, Album, Year, etc. are done using the same process. 此外,像标题,专辑,年份等其他信息都使用相同的过程来完成。

The format of the tags differ with different formats. 标签的格式随格式不同而不同。

For MP3 files, it is called ID3 . 对于MP3文件,它称为ID3

A suitable library would be TagLibSharp . 合适的图书馆会TagLibSharp You can get it here . 你可以在这里得到。 It supports a wide range of formats besides MP3 . 除了MP3之外,它还支持多种格式。

Example of modifying the album art can be found here . 修改的专辑封面的实施例可以找到这里

Other examples can also be found here . 其他的例子也可以找到这里

And the most basic example can be found here . 这里可以找到最基本的示例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM