title: Cant play sound more then 7 times in android
body: <p>When i play sound files in android i am getting this error:</p>
  
  <blockquote>
    <p>11-17 15:58:14.482 158-20904/? E/OMXNodeInstance:
    setConfig(f3f:google.mp3.decoder, ConfigPriority(0x6f800002)) ERROR:
    Undefined(0x80001001) 11-17 15:58:14.482 158-20904/? I/ACodec: codec
    does not support config priority (err -2147483648) 11-17 15:58:14.483
    158-20904/? I/MediaCodec: MediaCodec will operate in async mode 11-17
    15:58:14.488 158-20902/? E/AudioFlinger: not enough memory for
    AudioTrack size=131176 11-17 15:58:14.488 158-20902/? D/MemoryDealer: 
    AudioTrack (0xb731c9f0, size=1048576) 11-17 15:58:14.488 158-20902/?
    D/MemoryDealer:     0: 0xb94bbdf8 | 0x00000000 | 0x00020080 | A  11-17
    15:58:14.488 158-20902/? D/MemoryDealer:     1: 0xb94bbe28 |
    0x00020080 | 0x00020080 | A  11-17 15:58:14.488 158-20902/?
    D/MemoryDealer:     2: 0xb7bb4438 | 0x00040100 | 0x00020080 | A  11-17
    15:58:14.488 158-20902/? D/MemoryDealer:     3: 0xb7be71f8 |
    0x00060180 | 0x00020080 | A  11-17 15:58:14.488 158-20902/?
    D/MemoryDealer:     4: 0xb94bbca8 | 0x00080200 | 0x00020080 | A  11-17
    15:58:14.488 158-20902/? D/MemoryDealer:     5: 0xb7321998 |
    0x000A0280 | 0x00020080 | A  11-17 15:58:14.488 158-20902/?
    D/MemoryDealer:     6: 0xb73883d0 | 0x000C0300 | 0x00020080 | A  11-17
    15:58:14.488 158-20902/? D/MemoryDealer:     7: 0xb9e4f420 |
    0x000E0380 | 0x0001FC80 | F  11-17 15:58:14.488 158-20902/?
    D/MemoryDealer:   size allocated: 918400 (896 KB) 11-17 15:58:14.488
    158-20902/? E/AudioFlinger: createTrack_l() initCheck failed -12; no
    control block? 11-17 15:58:14.488 158-20902/? E/AudioTrack:
    AudioFlinger could not create track, status: -12 11-17 15:58:14.488
    158-20902/? E/AudioSink: Unable to create audio track 11-17
    15:58:14.488 158-20902/? W/NuPlayerRenderer: openAudioSink: non
    offloaded open failed status: -19 11-17 15:58:14.488 158-20902/?
    W/NuPlayerRenderer: onDrainAudioQueue(): audio sink is not ready 11-17
    15:58:14.489 158-20902/? W/NuPlayerRenderer: onDrainAudioQueue():
    audio sink is not ready 11-17 15:58:14.489 158-20902/?
    W/NuPlayerRenderer: onDrainAudioQueue(): audio sink is not ready 11-17
    15:58:14.490 158-20902/? W/NuPlayerRenderer: onDrainAudioQueue():
    audio sink is not ready</p>
  </blockquote>
  
  <p>here is my code:</p>
  
  <pre>
  
      public void playSound(int n) 
      {
         try {
                  Log.e("n value is", "" + n);
                  boolean mStartPlaying = true;
                  if (mStartPlaying == true) {
                      mPlayer = new MediaPlayer();
  
                      Uri uri = Uri.parse("android.resource://packagename/" + beeb.mp3);
                      mPlayer.setOnCompletionListener(soundListener);
                      mPlayer.setDataSource(getContext(), uri);
                      mPlayer.prepare();
                      mPlayer.setLooping(false);
                      mPlayer.start();
  
                  } else {
                      //   stopPlaying();
                      //rePlay.setText("Replay");
                      mPlayer.stop();
                      mPlayer.release();
                      mPlayer = null;
                  }
                  mStartPlaying = !mStartPlaying;
  
  
              } catch (IOException e) {
                  Log.e("ERR", "prepare() failed");
              }
          }
  
  </pre>