我想获取默认录音机录制的所有声音的arraylist。这怎么可能?我使用以下代码从sdcard获取所有声音,但它根本不包含录制的声音,它们具有3ga扩展名。
String selection = MediaStore.Audio.Media.IS_MUSIC + " != 0";
String[] projection = {
MediaStore.Audio.Media._ID,
MediaStore.Audio.Media.ARTIST,
MediaStore.Audio.Media.TITLE,
MediaStore.Audio.Media.DATA,
MediaStore.Audio.Media.DISPLAY_NAME,
MediaStore.Audio.Media.DURATION
};
Cursor cursor = ((Activity) ctx).managedQuery(
MediaStore.Audio.Media.EXTERNAL_CONTENT_URI,
projection,
selection,
null,
null
);
if(cursor != null) {
while(cursor.moveToNext()){
songs.add(new Song(cursor.getString(0), cursor.getString(4)));
}
}