0

I'm downloading the file sound1.mp3 from Firebase Storage as follows, but I don't know how to play the file, what should I do? FirebaseStorage storage=FirebaseStorage.getInstance();

StorageReference mp3_referansim= storage.getReference();
StorageReference MP3_İNDİR=mp3_referansim.child("ses1.mp3");

final File localFile= File.createTempFile("ses1","mp3");

public Okuma() throws IOException {
}



int yazı_boyutu,font,renk,satir_bosluk,oynat_durdur=0;

Bitmap bmp;

@RequiresApi(api = Build.VERSION_CODES.O)
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.okuma_activity);



    StorageReference MP3_İNDİR=mp3_referansim.child("ses1.mp3");
    MP3_İNDİR.getFile(localFile).addOnSuccessListener(new OnSuccessListener<FileDownloadTask.TaskSnapshot>() {
        @Override
        public void onSuccess(FileDownloadTask.TaskSnapshot taskSnapshot) {

            Toast.makeText(getApplicationContext(),"DOWNLOADED",
                    Toast.LENGTH_SHORT).show();


        }
    }).addOnFailureListener(new OnFailureListener() {
        @Override
        public void onFailure(@NonNull Exception exception) {
            Toast.makeText(getApplicationContext(),"FAILED",
                    Toast.LENGTH_SHORT).show();            }
    });
  • 1
    Possible duplicate of [Simple mediaplayer play mp3 from file path?](https://stackoverflow.com/questions/16715003/simple-mediaplayer-play-mp3-from-file-path) – Shynline Jan 08 '19 at 22:24
  • Unfortunately, it didn't work, because these are the explanations for playing music in the phone's memory. – ömer nasuhi aydemir Jan 09 '19 at 16:12

0 Answers0