title: Download and play .mp3 file from firebase storage to memory
body: <p>I need to download an mp3 file from my firebase storage gs://fir-b9532.appspot.com/songs/song1.mp3 and play it into my android application.
  I want to store the mp3 file temporary in my device's memory, play it with a mediaplayer and then bring a new song.</p>
  
  <p>I follow the firebase manual writing the following simple code but seems not working. ANy ideas whats going wrong?</p>
  
  <pre><code>package com.example.andreaskonstantakos.firebase;
  
   import android.media.MediaPlayer;
   import android.support.annotation.NonNull;
   import android.support.v7.app.AppCompatActivity;
   import android.os.Bundle;
   import com.google.android.gms.tasks.OnFailureListener;
   import com.google.android.gms.tasks.OnSuccessListener;
   import com.google.firebase.storage.FirebaseStorage;
   import com.google.firebase.storage.StorageReference;
  
  
   public class MainActivity extends AppCompatActivity {
  
       @Override
       protected void onCreate(Bundle savedInstanceState) {
           super.onCreate(savedInstanceState);
           setContentView(R.layout.activity_main);
  
           FirebaseStorage storage = FirebaseStorage.getInstance();
  
           StorageReference storageRef = storage.getReference();
           StorageReference songsRef = storageRef.child("songs");
           StorageReference song1Ref = storageRef.child("songs/song1.mp3");
  
           final long ONE_MEGABYTE = 1024 * 1024;
           song1Ref.getBytes(ONE_MEGABYTE).addOnSuccessListener(new OnSuccessListener&lt;byte[]&gt;() {
               @Override
               public void onSuccess(byte[] bytes) {
                   // Data for "songs/song1.mp3" is returns, use this as needed
                   MediaPlayer md = MediaPlayer.create(MainActivity.this,R.id.bytes);
                   md.setLooping(false);
                   md.start();
               }
      }).addOnFailureListener(new OnFailureListener() {
               @Override
               public void onFailure(@NonNull Exception exception) {
                   // Handle any errors
          }
      });
  
  }
  
  
   }
  </code></pre>