java - android如何获得mp3音乐的本地专辑图片
巴扎黑
巴扎黑 2017-04-17 17:52:48
0
2
526

部分代码如下

private static final Uri albumArtUri = Uri
            .parse("content://media/external/audio/albumart")
long albumId = cursor.getLong(
                    cursor.getColumnIndex(MediaStore.Audio.Media.ALBUM_ID));
Uri uri = ContentUris.withAppendedId(albumArtUri, album_id);

使用这个方法获得的是空的专辑图片,
同样,根据songidUri.parse("content://media/external/audio/media/"+ songid + "/albumart");也无法获得
是不是现在的MP3的专辑图片的信息不存储在数据库中了?

巴扎黑
巴扎黑

reply all(2)
巴扎黑

It seems that your method requires the support of the system's MediaScanner service.
It is recommended to get the album cover you want directly from the file. This data is stored in the ID3 information of the MP3 file.
You can check out this library: https: //github.com/mpatric/mp3agic

洪涛

I also encountered such a problem, how did the original poster solve it?

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!