title: Android Soundpool fails to play sound
body: <p>I am having trouble with playing multiple sound effects using the SoundPool class. Basically I am making a real time game that involves the user tapping a bunch of objects on the screen. Whenever the player touches an object, I need to play the sound. So I've turned to the SoundPool class. Below is my code:</p>
  
  <pre><code>private SoundPool mSoundPool;
  private int mSoundId;
  
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      PreferencesManager.getInstance(this);
  
      setContentView(R.layout.arcademode);
      initialize();
  }
  
  private void initialize() {
      this.setVolumeControlStream(AudioManager.STREAM_MUSIC);
      mSoundPool = new SoundPool(mBalloonPopCount, R.raw.pop, 0);
      mSoundId = mSoundPool.load(this, R.raw.pop, 1);
  }
  
  private void playSound() {
      float actualVolume = (float) audioManager.getStreamVolume(AudioManager.STREAM_MUSIC);
      float maxVolume = (float) audioManager.getStreamMaxVolume(AudioManager.STREAM_MUSIC);
      float volume = actualVolume / maxVolume;
      mSoundPool.play(mSoundId, volume, volume, 1, 0, 1f);
  }
  </code></pre>
  
  <p>Now whenever the <code>playSound()</code> method is called, I do not hear anything. When I look into LogCat, I see the following lines:</p>
  
  <pre><code>08-14 19:48:50.117: ERROR/AudioFlinger(2613): invalid stream type
  08-14 19:48:50.117: ERROR/AudioTrack(15611): AudioFlinger could not create track, status: -22
  08-14 19:48:50.117: ERROR/SoundPool(15611): Error creating AudioTrack
  </code></pre>
  
  <p>The audio file in question is a <strong>.wav</strong> file. I've also tried <strong>.ogg</strong> and <strong>.mp3</strong> files and they don't work either. The sound file is very small (the .wav file doesn't even take up 60KB) so size isn't the issue...</p>