title: Playing two sounds simultaneously - Android
body: <p>Is it possible to play two sound (mp3) files at the same time? I have tried using two different MediaPlayer objects-</p>
  
  <pre><code>MediaPlayer mediaPlayer;
  MediaPlayer mediaPlayer2;
  </code></pre>
  
  <p>to play the sounds, but that does not work. I cannot use SoundPool either as the sound files in use are around 10MB each (since SoundPool doesn't work well with sound files > 3MB).</p>
  
  <p>Here is some code to get familiar with my situation-</p>
  
  <pre><code>@Override
  public void onResume() {
      super.onResume();
      if(mediaPlayer == null)
      {
      mediaPlayer = MediaPlayer.create(getActivity().getApplicationContext(), R.raw.song1);
      }
      if(mediaPlayer2 == null)
      {
      mediaPlayer2 = MediaPlayer.create(getActivity().getApplicationContext(), R.raw.song2);
      }
  }
  private void startPlaying() {
  mediaPlayer.setLooping(true);
  mediaPlayer.start();
  mediaPlayer2.start();
  }
  </code></pre>
  
  <p>Any suggestions? Is there some way to make this 2 MediaPlayer objects approach work? If not then what other options are there? Code would be helpful!</p>