title: How to play several tracks simultaneously, using MediaPlayer?
body: <p>I have 8 mp3 files. And I have to play it simultaneously <em>(not nearly. will for sure)</em>.<br>
  I'm using '<a href="http://audacity.sourceforge.net/download/" rel="nofollow noreferrer">AudaCity</a>' for control accuracy. But my code did't give me the desired results...<br>(asynchrony = 30~90 ms)<br>
  So, it's my code:<br>
  <em>(for first start to play)</em></p>
  <pre><code>public void start() {
  //songInfo.getMediaPlayer() - it's array of MediaPlayers, source already setted
          for (MediaPlayer player : songInfo.getMediaPlayer()) {
              try {
                  if (player != null) {
                      player.prepare();
                      player.seekTo(0);
                  }
              } catch (Exception ex) {
                  ex.printStackTrace();
              }       
          }
          songInfo.getMediaPlayer()[0]
                  .setOnCompletionListener(new OnCompletionListener() {
                          @Override
                          public void onCompletion(MediaPlayer mp) {
                              //code for play next setlist
                          }
          });
          resume();
  }
  </code></pre>
  <p><em>(for pause)</em>
  <br></p>
  <pre><code>public void pause() {
          for (MediaPlayer player : songInfo.getMediaPlayer()) {
              if (player != null)
                  player.pause();
          }
  }
  </code></pre>
  <p><em>(for resume after pause, and for start play(used in first method))</em>
  <br></p>
  <pre><code>public void resume() {  
          int pos = songInfo.getMediaPlayer()[0].getCurrentPosition();
          long iTime = System.currentTimeMillis();
          for (MediaPlayer player : songInfo.getMediaPlayer()) {
              if (player != null) {
                  player.seekTo(pos + (int)(System.currentTimeMillis()-iTime));
                  player.start();
              }
          }
  }
  </code></pre>
  <p>If I start play in the first time it gives me asynchrony ~ 30ms+<br>
  Then after pause/resume it plays perfect.</p>