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

  • SEARCH
  • Home
  • 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 7902943
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T09:38:12+00:00 2026-06-03T09:38:12+00:00

I am using below code in my app to play the Sound. But i

  • 0

I am using below code in my app to play the Sound.
But i am not able to play it.
Whats the Problem ??

Code:

public void playSound(int resources){
    try{
        boolean mStartPlaying = true;
        MediaPlayer  mPlayer=null;
        if (mStartPlaying==true){
            mPlayer = new MediaPlayer();

            Uri uri = Uri.parse("android.resource://MY_PACKAGE/" + resources);
            mPlayer.setDataSource(getApplicationContext(),uri);
            mPlayer.prepare();
            mPlayer.start();
        } 
        else{
            mPlayer.release();
            mPlayer = null;
        }
        mStartPlaying = !mStartPlaying;
    }
    catch (IOException e){
        Log.e(LOG_TAG, "prepare() failed");
    }


}

And i get log cat as like below:

05-09 05:24:22.272: VERBOSE/PlayerDriver(95): Completed command PLAYER_INIT status=PVMFFailure
05-09 05:24:22.272: ERROR/PlayerDriver(95): Command PLAYER_INIT completed with an error or info PVMFFailure
05-09 05:24:22.272: ERROR/MediaPlayer(8072): error (1, -1)
05-09 05:24:22.272: ERROR/AudioPlayTest(8072): prepare() failed
05-09 05:24:22.282: VERBOSE/PVPlayer(95): run_set_video_surface s=-2147483648, cancelled=0
05-09 05:24:22.282: VERBOSE/PlayerDriver(95): HandleInformationalEvent: PVMFInfoErrorHandlingComplete
05-09 05:24:22.282: WARN/PlayerDriver(95): PVMFInfoErrorHandlingComplete
  • 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-06-03T09:38:13+00:00Added an answer on June 3, 2026 at 9:38 am

    Maybe you’re trying to play unsupported format.
    Do you know what fails? : new, setDataSource, prepare, start … moreover IOException tells you there is something wrong with input file, such FileNotFoundException or EOFException (try to printout a more specific exception as suggested here)

    ps.: moved comments in answer.

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

Sidebar

Related Questions

I am using below code. import android.app.Activity; import android.os.Bundle; import android.provider.ContactsContract.Data; import android.util.Log; public
I am using the below code in my app to make a beep sound.
Using the code below (from a console app I've cobbled together), I add seven
I wanted to generate a list view using below code. But after running this
I am building an Facebook IFrame App. I am using the below javascript code
I'm using the below code for my app. If I deny the permission, I
I am using below code to retrieve list of products -(void) viewWillAppear:(BOOL)animated { if
I using below code to insert new sms in inbox, but when i click
I am using below code to get uninstall package broadcast receiver but I don't
I'm trying to update a value in my app.config file using the code below

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.