获得有效的音频文件的流派,在MediaStore [英] Getting efficiently the Genres of the Audio files in the MediaStore

查看:167
本文介绍了获得有效的音频文件的流派,在MediaStore的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想同步自己的数据库,曲目和专辑(包含额外的数据)。我至今成功地拉到专辑和曲目从MediaStore。

I am trying to synchronize my own database for tracks and albums (that contains additional data). I have so far successfully pulled albums and tracks from the MediaStore.

我不能管理做适当的拉流派的轨道。可能有人张贴一些code?我想,以避免查询数据库中的每个磁道,所以如果可能的一些code加载关联(Genre.id< - > Audio.id)将是巨大的。

What I cannot manage to do properly is to pull the Genres for the tracks. Could someone post some code? I'd like to avoid querying the database for each track, so if possible some code to load the association (Genre.id <-> Audio.id) would be great.

我很努力在正在使用的内容提供商,以获得Genres.Members信息。

What I am struggling on is using the content provider to get the Genres.Members info.

推荐答案

我想看看ringdroid的优秀创作者如何做到这一点。 <一href="http://ringdroid.google$c$c.com/svn-history/r37/trunk/src/com/ringdroid/SongMetadataReader.java" rel="nofollow">http://ringdroid.google$c$c.com/svn-history/r37/trunk/src/com/ringdroid/SongMetadataReader.java

I'd take a look at how the excellent creators of ringdroid do this. http://ringdroid.googlecode.com/svn-history/r37/trunk/src/com/ringdroid/SongMetadataReader.java

他们基本上是通过检索类型名称和ID,并利用这些,他们可以很容易地创建一个CONTENT_URI这仅检索歌曲符合这些类型的数据库开始。 但如果我是你,我会检查是否有未知或空类型或不是包含在他们的ID3标签不流派名称的文件

They basically start by retrieving the genres names and ids and using those they can easily create a content_uri that retrieves only songs in the database that matches those genres. But if I were you I would check whether there is an "unknown" or "empty" genre or not for the files that contain no Genre name in their id3 tag

这篇关于获得有效的音频文件的流派,在MediaStore的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆