我想使用CoverArtArchiveClient从 MusicBrainz 加载专辑图像,但它需要 MusicBrainz ID ( MBID )。有人可以提供有关如何获取特定专辑的 MBID 的信息吗?代码示例将不胜感激。
谢谢
我想使用CoverArtArchiveClient从 MusicBrainz 加载专辑图像,但它需要 MusicBrainz ID ( MBID )。有人可以提供有关如何获取特定专辑的 MBID 的信息吗?代码示例将不胜感激。
谢谢
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. You want to get the MBID of release entities.
Since you seem to be developing on Android in Java you might be interested in musicbrainzws2-java the Java binding of the Web Service.
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.
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.
EDIT:
SO how-to-get-album-image-using-musicbrainz has an answer that tells how to use the web service directly.
The MusicBrainz web service can also return links/urls to coverart directly (as described in that answer). So you save another call to the CoverArtArchive.