Gracenote GNSDK is not retrieving genre on Android

こ雲淡風輕ζ 提交于 2020-01-06 14:01:12

问题


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:


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.



来源:https://stackoverflow.com/questions/30030365/gracenote-gnsdk-is-not-retrieving-genre-on-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!