title: How can I get rid of crackling noise when playing multiple sounds with SoundPool
body: <p>My app plays a short beep whenever the user touches a tile.  Sounds perfect.  However, if the user drags their finger it will play the beep multiple times in quick succession, which works but also makes a crackling, static kind of noise.  I'm trying to get rid of the crackle.</p>
  
  <p>I've tried many things that have <em>not</em> worked:</p>
  
  <ul>
  <li>Increasing the SoundPool max streams to 8 or 16 - no effect</li>
  <li>incrementing sndPriority so that each call to play() uses a higher priority than the last one - no effect</li>
  <li>calling sp.stop(sndPlaying) on the previous sound - this actually makes the crackle worse</li>
  <li>Tested on two different devices with different Android OS versions, same crackle</li>
  <li>I've tinkered with the sound file in Audacity and I am reasonably confident the crackle is not a problem with the sound file</li>
  </ul>
  
  <p>Code:</p>
  
  <pre><code>public void setup() {
    sp = new SoundPool(1, AudioManager.STREAM_MUSIC, 0);
    sndBeep = sp.load(panel.act.getApplicationContext(), R.raw.beep, 1);
  }
  public void play() {
    // sp.stop(sndPlaying);   -- this actually makes the crackling noise worse
    // sndPriority++;         -- this had no effect
    sndPlaying = sp.play(sndBeep, 1.0f, 1.0f, sndPriority, 0, sndFreq);
  }
  </code></pre>