java.io.IOException:|java.io.IOException: Prepare failed.: status=0x1
准备mediaPlay出错
java.io.IOException: Prepare failed.: status=0x1
at android.media.MediaPlayer._prepare(Native Method)
at android.media.MediaPlayer.prepare(MediaPlayer.java:1218)
at com.jumper.fhrinstruments.monitor.fhrmonitor.activity.PlayRecorderWavActivity.initMedia(PlayRecorderWavActivity.java:480)
at com.jumper.fhrinstruments.monitor.fhrmonitor.activity.PlayRecorderWavActivity.initAudioTrack(PlayRecorderWavActivity.java:431)
at com.jumper.fhrinstruments.monitor.fhrmonitor.activity.PlayRecorderWavActivity_.access$001(PlayRecorderWavActivity_.java:36)
at com.jumper.fhrinstruments.monitor.fhrmonitor.activity.PlayRecorderWavActivity_$2.run(PlayRecorderWavActivity_.java:116)
at android.os.Handler.handleCallback(Handler.java:755)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:156)
at android.app.ActivityThread.main(ActivityThread.java:6524)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:941)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:831)
【java.io.IOException:|java.io.IOException: Prepare failed.: status=0x1】报错解决方案
File file = new File(strPath);
FileInputStream fis = new FileInputStream(file);
mediaPlayer.setDataSource(fis.getFD());
mp.prepare();
推荐阅读
- 哥哥,森亚fai|哥哥,森亚fai 络!
- CGI,FastCGI,PHP-CGI与PHP-FPM
- Pytorch|Pytorch AlexNet Fashion-MNIST
- Java|Java spi(service provider interface)
- 最新Mac系统安装fastlane|最新Mac系统安装fastlane /usr/bin 权限问题
- 【天馬座|【天馬座 ? 翼ノ幻想】~《The Pegasus Fantasy》
- 二、NSUserDefaults
- 如何在facebook上打广告,流程是怎样的()
- fastapi教程翻译(一)(了解FastAPI结构)
- Netty|Netty 源码之 FastThreadLocal