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
Post a Comment