Java.IO.IOException: Prepare failed.: status=0x1 can't fix it

YasserEl-DiasttyYasserEl-Diastty USMember ✭✭
edited October 2016 in Xamarin.Android

Helloo
when i click on a button to play a media file
it gives me "Java.IO.IOException: Prepare failed.: status=0x1"
and it was working before but not it doesn't work
how to fix it ?
thanks in advance ^^

my code
`MediaPlayer media;

        media = new MediaPlayer();


        btnPlaySound.Click += delegate
        {
            pos = Watch_Listen.viewPager.CurrentItem;
            media.Reset();
            media.SetDataSource(SuraNames.SuraLinks[pos+1]);
            media.Prepare();
            media.Start();
            t.Start();
        };`
Tagged:

Answers

  • Same here

  • RianDutraRianDutra USMember ✭✭
    edited February 2017

    It seems the player couldn't play the audio format or didn't find the file.
    What is your audio file? What format?

    Just for test it, replace the audio URI for a mp3 file that works well.
    media.SetDataSource(SuraNames.SuraLinks[pos+1]);

    For example (change the URI):
    media.SetDataSource("http://somesite.com/test.mp3");

  • matheusvsamatheusvsa USMember

    Same here

Sign In or Register to comment.