我無法找到解決此問題的解決方案。 我只需要播放一個音頻文件並獲取該文件的持續時間。有時它工作正常,但它顯示錯誤:android:mediaplayer error(1,-17)
下面是我的logcat:
請幫我stucked。
02-01 12:30:40.287: E/MediaPlayer(256): error (1, -17)
02-01 12:30:41.896: D/MediaPlayer(256): create failed:
02-01 12:30:41.896: D/MediaPlayer(256): java.io.IOException: Prepare failed.: status=0x1
02-01 12:30:41.896: D/MediaPlayer(256): at android.media.MediaPlayer.prepare(Native Method)
02-01 12:30:41.896: D/MediaPlayer(256): at android.media.MediaPlayer.create(MediaPlayer.java:644)
02-01 12:30:41.896: D/MediaPlayer(256): at PointOf1761.onClick(PointOf1761.java:953)
02-01 12:30:41.896: D/MediaPlayer(256): at android.view.View.performClick(View.java:2364)
02-01 12:30:41.896: D/MediaPlayer(256): at android.view.View.onTouchEvent(View.java:4179)
02-01 12:30:41.896: D/MediaPlayer(256): at android.view.View.dispatchTouchEvent(View.java:3709)
02-01 12:30:41.896: D/MediaPlayer(256): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
02-01 12:30:41.896: D/MediaPlayer(256): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
02-01 12:30:41.896: D/MediaPlayer(256): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
02-01 12:30:41.896: D/MediaPlayer(256): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
02-01 12:30:41.896: D/MediaPlayer(256): at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1659)
02-01 12:30:41.896: D/MediaPlayer(256): at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1107)
02-01 12:30:41.896: D/MediaPlayer(256): at android.app.Activity.dispatchTouchEvent(Activity.java:2061)
02-01 12:30:41.896: D/MediaPlayer(256): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1643)
02-01 12:30:41.896: D/MediaPlayer(256): at android.view.ViewRoot.handleMessage(ViewRoot.java:1691)
02-01 12:30:41.896: D/MediaPlayer(256): at android.os.Handler.dispatchMessage(Handler.java:99)
02-01 12:30:41.896: D/MediaPlayer(256): at android.os.Looper.loop(Looper.java:123)
02-01 12:30:41.896: D/MediaPlayer(256): at android.app.ActivityThread.main(ActivityThread.java:4363)
02-01 12:30:41.896: D/MediaPlayer(256): at java.lang.reflect.Method.invokeNative(Native Method)
02-01 12:30:41.896: D/MediaPlayer(256): at java.lang.reflect.Method.invoke(Method.java:521)
02-01 12:30:41.896: D/MediaPlayer(256): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
02-01 12:30:41.896: D/MediaPlayer(256): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
02-01 12:30:41.896: D/MediaPlayer(256): at dalvik.system.NativeStart.main(Native Method)
it says in line 953
i have this in 953
953 female = MediaPlayer.create(this, femaleNum[i]);
954 handler.postDelayed(new Runnable() {
955
956 @Override
957 public void run() {
958 female.start();
959
960 }
961 },1000);
任何解決方案? PLZ幫助 – Donald 2012-02-01 07:37:09