Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6932699
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:44:19+00:00 2026-05-27T11:44:19+00:00

I am developing an Android media player streaming application. I get the following exception:

  • 0

I am developing an Android media player streaming application. I get the following exception:

 12-11 11:12:06.298: INFO/StagefrightPlayer(34): setDataSource('10.0.2.2\a.mp3')
 12-11 11:12:06.308: DEBUG/mp(618): starting
 12-11 11:12:06.308: ERROR/MediaPlayer(618): start called in state 4
 12-11 11:12:06.308: ERROR/MediaPlayer(618): error (-38, 0)
 12-11 11:12:06.328: ERROR/MediaPlayer(618): error (1, -2147483648)
 12-11 11:12:06.328: ERROR/MediaPlayer(618): Error (-38,0)
 12-11 11:12:06.409: ERROR/MediaPlayer(618): Error (1,-2147483648)
        String url = "10.0.2.2\\a.mp3"; // your URL here
        MediaPlayer mediaPlayer = new MediaPlayer();
        mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
        try {
            mediaPlayer.setDataSource(url);
        } catch (IllegalArgumentException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (IllegalStateException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        try {
            mediaPlayer.prepareAsync();
        } catch (IllegalStateException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        Log.d("mp","starting");
        mediaPlayer.start();

When using mediaPlayer.prepare I get the following error message:

 12-11 12:08:42.367: ERROR/MediaPlayer(980): error (1, -2147483648)
 12-11 12:08:42.367: WARN/System.err(980): java.io.IOException: Prepare failed.: status=0x1
 12-11 12:08:42.378: WARN/System.err(980):     at android.media.MediaPlayer.prepare(Native Method)
 12-11 12:08:42.378: WARN/System.err(980):     at mobiledo.pjct.Voicesms.onCreate(Voicesms.java:52)
 12-11 12:08:42.387: WARN/System.err(980):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
 12-11 12:08:42.387: WARN/System.err(980):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
 12-11 12:08:42.387: WARN/System.err(980):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
 12-11 12:08:42.387: WARN/System.err(980):     at android.app.ActivityThread.access$1500(ActivityThread.java:117)
 12-11 12:08:42.387: WARN/System.err(980):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
 12-11 12:08:42.387: WARN/System.err(980): at android.os.Handler.dispatchMessage(Handler.java:99)
 12-11 12:08:42.418: WARN/System.err(980):     at android.os.Looper.loop(Looper.java:123)
 12-11 12:08:42.418: WARN/System.err(980):     at android.app.ActivityThread.main(ActivityThread.java:3683)
 12-11 12:08:42.418: WARN/System.err(980):     at java.lang.reflect.Method.invokeNative(Native Method)
 12-11 12:08:42.418: WARN/System.err(980):     at java.lang.reflect.Method.invoke(Method.java:507)
 12-11 12:08:42.418: WARN/System.err(980):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
 12-11 12:08:42.418: WARN/System.err(980):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
 12-11 12:08:42.418: WARN/System.err(980):     at dalvik.system.NativeStart.main(Native Method)             
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T11:44:20+00:00Added an answer on May 27, 2026 at 11:44 am

    You prepare the MediaPlayer instance asynchronously, but you call start right after that, this causes the exception since the MediaPlayer is not ready. You should register a OnPreparedListener (before you call prepareAsync) and in this listener call start():

    mediaPlayer.setOnPreparedListener(new OnPreparedListener(){
        public void onPrepared(MediaPlayer mp) {
            mp.start();
        }
    });
    mediaPlayer.prepareAsync();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing an Android application where I get the following exception while writing
I am developing media player and my application download mp3 file from server .
I'm developing a media player application in Android. I've an animation (Open Gl Surface
I'm currently developing an Android application that fetches images using http requests. It would
We've been developing an Android application which includes Google Adsense. However there seems to
I am about to start developing an Android application and had a question if
I'm developing an augmented reality application for Android that uses the phone's camera to
I have been developing Android application where I use this code: Date d=new Date(new
I have been developing Android application and I can't make 1 thing - my
I have been developing Android application, and I have one question - ListView uses

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.