获得有效的音频文件的流派,在MediaStore

编程入门 行业动态 更新时间:2024-10-28 10:31:22
本文介绍了获得有效的音频文件的流派,在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的优秀创作者如何做到这一点。 ringdroid.google$c$c/svn-history/r37/trunk/src/com/ringdroid/SongMetadataReader.java

I'd take a look at how the excellent creators of ringdroid do this. ringdroid.googlecode/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

本文发布于:2023-10-29 17:13:07,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1540288.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:流派   音频文件   MediaStore

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!