mediaPlayer
sınıfında ListView
dosyasında bir dosyayı oynatmaya çalıştım. Bunun gibijava.io.IOException: Hazırla başarısız .: status = 0x1 Android
:
public void initializeViews() {
Intent intent = getIntent();
String fName = intent.getStringExtra("fileName");
fileName = (TextView) findViewById(R.id.fileName);
duration = (TextView) findViewById(R.id.songDuration);
seekbar = (SeekBar) findViewById(R.id.seekBar);
playBtn = (ImageButton) findViewById(R.id.media_play);
try {
mediaPlayer = new android.media.MediaPlayer();
mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
mediaPlayer.setDataSource(fName);
mediaPlayer.prepare();
}
catch (IOException e) {
e.printStackTrace();
}
fileName.setText(fName.substring(fName.lastIndexOf("/") + 1));
finalTime = mediaPlayer.getDuration();
seekbar.setOnSeekBarChangeListener(mOnSeek);
seekbar.setMax((int) finalTime);
seekbar.setClickable(true);
mediaPlayer.start();
timeElapsed = mediaPlayer.getCurrentPosition();
seekbar.setProgress((int) timeElapsed);
durationHandler.postDelayed(updateSeekBarTime, 200);
}
internette arama ve çoğu soru dosyaya yolunu kontrol olmakla fName
bir dosyanın tam yolunu aldık. Ama durum gösteren bilmiyorum:
java.io.IOException: Prepare failed.: status=0x1
Tüm günlük uygulama durum oluştuğunda: iznine okuyarak neden
E/MediaPlayer: error (1, -2147483648)
W/System.err: java.io.IOException: Prepare failed.: status=0x1
W/System.err: at android.media.MediaPlayer.prepare(Native Method)
W/System.err: at kr.co.composer.callrecord.media.AudioPlayer.initializeViews(AudioPlayer.java:56)
W/System.err: at kr.co.composer.callrecord.media.AudioPlayer.onCreate(AudioPlayer.java:42)
W/System.err: at android.app.Activity.performCreate(Activity.java:5231)
W/System.err: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
W/System.err: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2148)
W/System.err: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233)
W/System.err: at android.app.ActivityThread.access$800(ActivityThread.java:135)
W/System.err: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
W/System.err: at android.os.Handler.dispatchMessage(Handler.java:102)
W/System.err: at android.os.Looper.loop(Looper.java:136)
W/System.err: at android.app.ActivityThread.main(ActivityThread.java:5001)
W/System.err: at java.lang.reflect.Method.invokeNative(Native Method)
W/System.err: at java.lang.reflect.Method.invoke(Method.java:515)
W/System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
W/System.err: at dalvik.system.NativeStart.main(Native Method)
E/MediaPlayer: Attempt to call getDuration without a valid mediaplayer
E/MediaPlayer: error (-38, 0)
E/MediaPlayer: start called in state 0
E/MediaPlayer: error (-38, 0)
E/MediaPlayer: Error (-38,0)
E/MediaPlayer: Error (-38,0)
W/EGL_genymotion: eglSurfaceAttrib not implemented
stop called in state 0
error (-38, 0)
stop called in state 0
error (-38, 0)
Error (-38,0)
Error (-38,0)
stop called in state 0
error (-38, 0)
Error (-38,0)
pause called in state 0
error (-38, 0)
Başka kayıt ekleyebilir misiniz? –
@ TungD.Nguyen İlgili sorularımı güncelledim. –