Playing wave files in Android
<p>I am trying to play a wave file(VoiceMail) in Android. The file is downloaded from a remote server and written to sdcard.</p>

<p>I use the following code to play the Wave file usign the MediaPlayer class bundled with the SDK:</p>

<pre><code>FileDescriptor fd = new FileInputStream(songFile).getFD();              

                MediaPlayer mMediaPlayer = new MediaPlayer();

                mMediaPlayer.reset();
                try{
                    mMediaPlayer.setDataSource(fd);
                }
                catch(IllegalStateException e){
                    mMediaPlayer.reset();
                    mMediaPlayer.setDataSource(fd);
                }
                mMediaPlayer.prepare();                     
                mMediaPlayer.start();
</code></pre>

<p>However when I run my code, I get the following error:
Command PLAYER_SET_DATA_SOURCE completed with an error or info PVMFErrNotSupported
error (1, -4).</p>

<p>Note that when I pull this file on my desktop machine and copy it to the Music folder of my HTC hero device, the Music player of the device can play this file so I am guessing the file format is compatible with Android.</p>

<p>Not sure of what the problem is; please help.</p>

<p>Thanks.</p>
