是否可以从文件路径或文件输入流中检索 mp3 文件的位图(专辑封面)。就像使用 BitmapFactory API 或其他一些 API。
最佳答案
是的,可以获得 mp3 封面。
MediaMetadataRetriever mmr = new MediaMetadataRetriever();
mmr.setDataSource(mPath);
InputStream inputStream = null;
if (mmr.getEmbeddedPicture() != null) {
inputStream = new ByteArrayInputStream(mmr.getEmbeddedPicture());
}
mmr.release();
bitmap = BitmapFactory.decodeStream(inputStream);
关于android - 是否可以从 mp3 文件或文件输入流中获取位图(专辑封面)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30365997/