Playing wave files in Android -


i trying play wave file(voicemail) in android. file downloaded remote server , written sdcard.

i use following code play wave file usign mediaplayer class bundled sdk:

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(); 

however when run code, following error: command player_set_data_source completed error or info pvmferrnotsupported error (1, -4).

note when pull file on desktop machine , copy music folder of htc hero device, music player of device can play file guessing file format compatible android.

not sure of problem is; please help.

thanks.

another issue may file has been corrupted during download somehow... had exact same issue images downloaded google images search... reason files kept getting corrupted... still haven't found solution. think somehow http client losing packets.


Comments

Popular posts from this blog

windows - Why does Vista not allow creation of shortcuts to "Programs" on a NonAdmin account? Not supposed to install apps from NonAdmin account? -

c++ - How do I get a multi line tooltip in MFC -

unit testing - How to mock PreferenceManager in Android? -