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 7550495
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T10:13:42+00:00 2026-05-30T10:13:42+00:00

The MediaPlayer makes my app freeze without throwing an exception when I pass corrupted

  • 0

The MediaPlayer makes my app freeze without throwing an exception when I pass corrupted audio files to it. Here’s my code:

try
{
    if (this.mediaPlayer.isPlaying())
    {
        this.mediaPlayer.reset();
    }

    this.mediaPlayer.setDataSource(this.currentSong.getFile() /* path string */);
    this.mediaPlayer.prepare();
    this.mediaPlayer.start();
}
catch (Exception e)
{
    Log.v("Oh snap", "MediaPlayer exception: " + e.toString());
}

What can I do about this? I need an exception to handle corrupted files properly. The test device is a Samsung Galaxy S2 running Android 2.3.6 and I’m targeting API level 8.

I’m not sure what’s wrong with the corrupted flac files that I’m passing to the MediaPlayer. All I know is that they crash my app and the stock music player too, which shouldn’t happen.

  • 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-30T10:13:44+00:00Added an answer on May 30, 2026 at 10:13 am

    If it’s a native crash there’s very little you can do just from the Java layer. Check this answer for a slightly scary guide to the frightful hacking you’d need to do.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Part of my code goes like this: while(1){ my $winmm = new Win32::MediaPlayer; $winmm->load('1.mp3');
I wrote this code in order to make a soundboard like app public class
I have a mediaplayer that can only read samba shared files. I would like
im trying to echo mediaplayer embed code with IF statement. is there any way
I'd like to add custom controls to the mediaPlayer control view much as this
I'm working on an app that will both record an audio file, and then
Here is my problem I use the mediaplayer integrated in a uiwebview to show
I am trying to get this string to return Minute:Second:Millisecond for my MediaPlayer. I
Originally, I had a MediaPlayer mPlayers to play/pause/stop my Audio file. Now, I'm trying
I'm trying to stream 1.5-4 hour audio files from a URL. I have my

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.