title: using phonegap to play a wav in android
body: <p>I am trying to play a wav file from my PG application and it works properly on the iPhone.</p>
  
  <p>I have read all the following:
  <a href="https://stackoverflow.com/questions/10556437/audio-not-working-with-phonegap">audio not working with phoneGap</a>
  <a href="https://stackoverflow.com/questions/4159117/how-to-play-song-in-android-phonegap">How to play song in Android - phonegap</a>
  <a href="https://stackoverflow.com/questions/4438822/playing-local-sound-in-phonegap">Playing local sound in phonegap</a></p>
  
  <p>I am using PGB to compile my app and its using PG 1.7.0.</p>
  
  <p>I just can figure out how to make it play :(</p>
  
  <p>I tried using </p>
  
  <pre><code>function getPhoneGapPath() {
      var path = window.location.pathname;
      path = path.substr( path, path.length - 10 );
      return 'file://' + path;
  };
  
  var pathToCheerFile=getPhoneGapPath()+ 'sounds/cheer.wav';
  console.log('pathToCheerFile=',pathToCheerFile);
  
  return new Media(pathToCheerFile,
          // success callback
          function() {
              console.log("cheer Audio loaded Success");
          },
          // error callback
          function(err) {
              console.log("cheer Audio load Error: " , err);
          },
  );
  </code></pre>
  
  <p>The console is showing <code>pathToCheerFile=file:///android_asset/www/sounds/cheer.wav</code>
  and later it shows <code>cheer Audio load Error:</code> with err being an object that has a single property <code>code:1</code>.</p>
  
  <p>any ideas on what am I doing wrong ?</p>