Gracenote GNSDK is not retrieving genre on Android

2019-09-06 19:05发布

I'm studiyng gracenote gnsdk in an android application. With the developer key I have, I can retrieve basic information about the music, but I can't retrieve info such as mood and genre.

Does anyone knows a way to get this information? I'm following the example, like this:

String genre = gnAlbum.trackMatched().genre(GnDataLevel.kDataLevel_1);
if(genre == null || genre.isEmpty()){
    genre = gnAlbum.genre(GnDataLevel.kDataLevel_1);
}

Thanks in advance!

1条回答
劳资没心,怎么记你
2楼-- · 2019-09-06 19:18

according to the docs you have to load a locale object to get genre results, e.g.

mGnLocale = new GnLocale(GnLocaleGroup.kLocaleGroupMusic, GnLanguage.kLanguageEnglish, GnRegion.kRegionGlobal, GnDescriptor.kDescriptorDefault, mGnUser);
mGnLocale.setGroupDefault();

this takes quite a while so you might want to run that in a separate thread.

查看更多
登录 后发表回答