01-15 00:57:08.660: WARN/System.err(25286): java.io.IOException: setDataSourceFD failed.: status=0x80000000 01-15 00:57:08.660: WARN/System.err(25286): at android.media.MediaPlayer.setDataSource(Native Method) 01-15 00:57:08.660: WARN/System.err(25286): at android.media.MediaPlayer.setDataSource(MediaPlayer.java:854) ...
... while trying to play a local AMR audio file from the application cache directory. This happens on HTC Magic, HTC Desire. The AMR audio file is recorded by SonyEricsson xperia x10 mini and downloaded from the Internet.
MediaPlayer is created as follows:
MediaPlayer player = new MediaPlayer(); player.setOnCompletionListener(this); player.setOnErrorListener(this); player.setAudioStreamType(AudioManager.STREAM_MUSIC); try { FileInputStream fis = new FileInputStream(filePath); player.setDataSource(fis.getFD()); } catch (Exception e) { ... }
Any ideas?
source share