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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T22:13:23+00:00 2026-05-31T22:13:23+00:00

I have done like if user click on the Button then the Sound is

  • 0

I have done like if user click on the Button then the Sound is play. But right now i am not able to listern sound after some clicks. I dont know why ?

Here is the code that i am using to play the sound.

Code:

case R.id.lockView:
        playSound(R.raw.dooropen);
        break;
    }

public void playSound(int resources){
    boolean mStartPlaying = true;
    if (mStartPlaying==true){
        mPlayer = new MediaPlayer();
        Uri uri = Uri.parse("android.resource://com.project.iMystick/" + resources);
        try{
            mPlayer.setDataSource(getApplicationContext(),uri);
            mPlayer.prepare();
            mPlayer.start();
        } 
        catch (IOException e){
            Log.e(LOG_TAG, "prepare() failed");
        }
    } 
    else{
       //   stopPlaying();
        //rePlay.setText("Replay");
        mPlayer.release();
        mPlayer = null;
    }
    mStartPlaying = !mStartPlaying;
}

And After some clicks i got this type of error message in logcat:

Log:

03-27 16:15:02.737: ERROR/MediaPlayer(1057): Error (-19,0)
03-27 16:15:03.858: DEBUG/AudioSink(34): bufferCount (4) is too small and increased to 12
03-27 16:15:03.858: ERROR/AudioFlinger(34): not enough memory for AudioTrack size=32832
03-27 16:15:03.858: DEBUG/MemoryDealer(34):   AudioTrack (0x12abf8, size=1048576)
03-27 16:15:03.858: DEBUG/MemoryDealer(34):     0: 0012ac10 | 0x00000000 | 0x00008040 | A 
03-27 16:15:03.858: DEBUG/MemoryDealer(34):     1: 0012aca0 | 0x00008040 | 0x00008040 | A 
03-27 16:15:03.858: DEBUG/MemoryDealer(34):     2: 0012b5a8 | 0x00010080 | 0x00008040 | A 
03-27 16:15:03.858: DEBUG/MemoryDealer(34):     3: 0012bec8 | 0x000180C0 | 0x00008040 | A 
03-27 16:15:03.858: DEBUG/MemoryDealer(34):     4: 0012c7f0 | 0x00020100 | 0x00008040 | A 
03-27 16:15:03.858: DEBUG/MemoryDealer(34):     5: 0012d1f0 | 0x00028140 | 0x00008040 | A 
03-27 16:15:03.858: DEBUG/MemoryDealer(34):     6: 0012db20 | 0x00030180 | 0x00008040 | A 
03-27 16:15:03.858: DEBUG/MemoryDealer(34):     7: 00136448 | 0x000381C0 | 0x00008040 | A 
03-27 16:15:03.858: DEBUG/MemoryDealer(34):     8: 0013ee00 | 0x00040200 | 0x00008040 | A 
03-27 16:15:03.858: DEBUG/MemoryDealer(34):     9: 0000de10 | 0x00048240 | 0x00008040 | A 
03-27 16:15:03.858: DEBUG/MemoryDealer(34):    10: 0012b708 | 0x00050280 | 0x00008040 | A 
03-27 16:15:03.858: DEBUG/MemoryDealer(34):    11: 00022c70 | 0x000582C0 | 0x00008040 | A 
03-27 16:15:03.858: DEBUG/MemoryDealer(34):    12: 000234c0 | 0x00060300 | 0x00008040 | A 
03-27 16:15:03.858: DEBUG/MemoryDealer(34):    13: 00115e38 | 0x00068340 | 0x00008040 | A 
03-27 16:15:03.858: DEBUG/MemoryDealer(34):    14: 00117a80 | 0x00070380 | 0x00008040 | A 
03-27 16:15:03.858: DEBUG/MemoryDealer(34):    15: 00118798 | 0x000783C0 | 0x00008040 | A 
03-27 16:15:03.858: DEBUG/MemoryDealer(34):    16: 00042228 | 0x00080400 | 0x00008040 | A 
03-27 16:15:03.858: DEBUG/MemoryDealer(34):    17: 0004bd48 | 0x00088440 | 0x00008040 | A 
03-27 16:15:03.858: DEBUG/MemoryDealer(34):    18: 00055998 | 0x00090480 | 0x00008040 | A 
03-27 16:15:03.858: DEBUG/MemoryDealer(34):    19: 0005f5f0 | 0x000984C0 | 0x00003040 | A 
03-27 16:15:03.858: DEBUG/MemoryDealer(34):    20: 000712b0 | 0x0009B500 | 0x00008040 | A
03-27 16:15:03.867: ERROR/AudioTrack(34): AudioFlinger could not create track, status: -12
03-27 16:15:03.867: ERROR/AudioSink(34): Unable to create audio track
03-27 16:15:03.877: ERROR/MediaPlayer(1057): error (-19, 0)

enter code here
  • 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-31T22:13:24+00:00Added an answer on May 31, 2026 at 10:13 pm

    You need to release() the media players otherwise the resources are not released , and you soon get out of memory (since you allocate them again next time).
    so,I think you can play twice or even thrice… but not many times without releasing the resources

    It is recommended that once a MediaPlayer object is no longer being used, call release() immediately so that resources used by the internal player engine associated with the MediaPlayer object can be released immediately. Resource may include singleton resources such as hardware acceleration components and failure to call release() may cause subsequent instances of MediaPlayer objects to fallback to software implementations or fail altogether.See this link

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

Sidebar

Related Questions

It's the first time I have done anything like this but wondered what the
Most of my development life, I have done a JavaScript generated button like so:
I feel like GUID/UUID questions have been done to death here, but I can't
i have done something like this: <form action=validate.php method=get> Id :<input type=text name=pID/><br/><br/> Name
I want to make a reverse string function and I have done it like
I would like to read custom setting which i have done in ServiceConfiguration.cscfg &
I am trying to create something like this as i have done it in
I have never done any Windows coding and I would like to give it
I would like to track how many surveys have been done by different departments
Not sure if my title is worded well, but whatever :) I have two

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.