title: Android code to play .wav files located in res/raw - weird errors
body: <p>I've been stuck on this particular problem for a while now, and it's something that should be really simple so it's annoying.. I must be misusing the Android API somehow?</p>
  
  <p>Here is the code:</p>
  
  <pre><code>  try {
    String packageName = getPackageName(); 
    int resID = getResources().getIdentifier( "filename" , "raw" , packageName ); //in res/raw folder I have filename.wav audio file
    mp.setDataSource("android.resource://" + packageName + "/" + resID);
    mp.prepare();
    mp.start();
  } catch (Exception e) {
    Toast.makeText(PlayScreen.this, e.toString(), Toast.LENGTH_LONG).show(); 
  }
  </code></pre>
  
  <p>The toast message I see says:</p>
  
  <pre><code>java.io.IOException: Prepare failed.: status=0xFFFFFFFC
  </code></pre>
  
  <p>In eclipse logcat I see:</p>
  
  <pre><code>MediaPlayer Error (-4 -4)
  </code></pre>
  
  <p>Much thanks to anyone who can help with this... I just want to play my wav files darn it! </p>