I m trying to include the Album Art out of a mp3 file into my application, but it says: Call to getEmbeddedPicture failed.
在我的Song类中,我确定了每一歌的艺术作品:
metaDataRetriver = new MediaMetadataRetriever();
metaDataRetriver.setDataSource(path);
//path = /mnt/sdcard/chan_mp3/Titel.mp3
byte[] artwork = metaDataRetriver.getEmbeddedPicture();
在我的习俗Adapter中,我试图展示:
// This code works perfectly fine: for each song I get artist and title
textView.setText(values.get(position).getArtist() + " - " + values.get(position).getTitle());
// This code doesn t work at all
byte[] artwork = values.get(position).getArtwork();
Bitmap bMap = BitmapFactory.decodeByteArray(artwork, 0, artwork.length);
imageView.setImageBitmap(bMap);
问题在于我失踪了什么? 艺术品变数不是正确的,还是我的要求是错误的?
或者,是否采取了更好的办法来获取图书封面和音乐信息?