简体   繁体   English

如何获得专辑的MusicBrainz ID

[英]How to get an Album's MusicBrainz ID

I want to use the CoverArtArchiveClient to load Album Images from MusicBrainz but it requires a MusicBrainz ID ( MBID ). 我想使用CoverArtArchiveClient从MusicBrainz加载专辑图像,但它需要一个MusicBrainz ID( MBID )。 Can someone provide info on how to get the MBID for a particular Album? 有人可以提供有关如何获取特定相册的MBID的信息吗? Code samples would be much appreciated. 我们非常感谢代码示例。

Thanks 谢谢

The details depend a lot on what representation you have of "a particular album". 细节很大程度上取决于你对“特定专辑”的表现形式。

In general MusicBrainz provides a web service (in XML and json format) where you can search for MusicBrainz entities, which will also give you the MBID. 通常,MusicBrainz提供了一个Web服务(XML和json格式),您可以在其中搜索 MusicBrainz实体,这也将为您提供MBID。 You want to get the MBID of release entities. 您想获得发布实体的MBID。

Since you seem to be developing on Android in Java you might be interested in musicbrainzws2-java the Java binding of the Web Service. 由于您似乎是在Java上使用Android开发,因此您可能对musicbrainzws2-java Web服务的Java绑定感兴趣。

There are other language bindings/libraries available for the current version (WS/2 = "NGS") of the web service and you always have the option to use the web service directly. Web服务的当前版本(WS / 2 =“NGS”)还有其他语言绑定/库 ,您始终可以选择直接使用Web服务。

If you have the album available in the form of tagged audio files, then you should try to extract the tags, since sometimes MBIDs are already available in the files and you don't have to search on MusicBrainz. 如果您以标记的音频文件的形式提供相册,那么您应该尝试提取标签,因为有时MBID已经在文件中可用而您不必搜索MusicBrainz。

EDIT: 编辑:
SO how-to-get-album-image-using-musicbrainz has an answer that tells how to use the web service directly. 因此,如何获取专辑图像使用musicbeinz有一个答案,告诉如何直接使用Web服务。 The MusicBrainz web service can also return links/urls to coverart directly (as described in that answer). MusicBrainz Web服务还可以直接将链接/ URL返回到coverart(如该答案中所述)。 So you save another call to the CoverArtArchive. 所以你保存了另一个对CoverArtArchive的调用。

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

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