3

Mp3 file not showing in any application after the mp3 file is saved . After 15 odd minutes it is automatically shown . if i manually change the name from file manager it will be instantly shown . How to solve this problem .

Uri uri = MediaStore.Audio.Media.EXTERNAL_CONTENT_URI;
            String[] projection = {
                    MediaStore.Audio.Media.TITLE,
                    MediaStore.Audio.Media.DATA,
                    MediaStore.Audio.Media.DISPLAY_NAME,
                    MediaStore.Audio.Media.DURATION,
                    MediaStore.Audio.Media.ALBUM_ID
            };
            String sortOrder =  MediaStore.Audio.Media.DISPLAY_NAME
            Cursor c = getContentResolver().query(uri,projection,null,null,sortOrder);
            if(c.moveToFirst())
            {
                do {
                    String title = c.getString(c.getColumnIndex(MediaStore.Audio.Media.TITLE));
                    String data = c.getString(c.getColumnIndex(MediaStore.Audio.Media.DATA));
                    String name = c.getString(c.getColumnIndex(MediaStore.Audio.Media.DISPLAY_NAME));
                    String duration = c.getString(c.getColumnIndex(MediaStore.Audio.Media.DURATION));
                    String albumid= c.getString(c.getColumnIndex(MediaStore.Audio.Media.ALBUM_ID));
                    Songs song = new Songs(title,data,name,duration,albumid);
                    songs.add(song);
                    title1.add(name);
                }while (c.moveToNext());
            }

Output file path:

 Environment.getExternalStorageDirectory()+ "/Trim"+".mp3";

This is my command:

"-y","-ss", start,"-i", input_path,"-t", end,"-metadata","title=Trim","-acodec", "copy","-preset", "ultrafast",output_path
Md.Sukel Ali
  • 2,987
  • 5
  • 22
  • 34
Aashit Shah
  • 578
  • 3
  • 9
  • 1
    Have a look at `MediaScannerConnection`. https://stackoverflow.com/questions/4646913/android-how-to-use-mediascannerconnection-scanfile – laalto May 04 '19 at 06:36

0 Answers0