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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T20:23:22+00:00 2026-06-13T20:23:22+00:00

I am facing a vague issue with sound manager. Only the first sound that

  • 0

I am facing a vague issue with sound manager. Only the first sound that I load, works. The 2nd sound does not.

Initialization, here WRONG_SOUND does not load.

Globals.mSoundManager = new SoundManager();
Globals.mSoundManager.initSounds(getBaseContext());
Globals.mSoundManager.addSound(Globals.CORRECT_SOUND, R.raw.correct);
Globals.mSoundManager.addSound(Globals.WRONG_SOUND, R.raw.wrong);

If I reverse the loading, CORRECT_SOUND does not load

Globals.mSoundManager = new SoundManager();
Globals.mSoundManager.initSounds(getBaseContext());
Globals.mSoundManager.addSound(Globals.WRONG_SOUND, R.raw.wrong);
Globals.mSoundManager.addSound(Globals.CORRECT_SOUND, R.raw.correct);

Constructor of SoundManager

public void initSounds(Context theContext) {
    mContext = theContext;
    mSoundPool = new SoundPool(4, AudioManager.STREAM_MUSIC, 0);
    mSoundPool.setOnLoadCompleteListener(this);
    mSoundPoolMap = new HashMap<Integer, Integer>();
    mAudioManager = (AudioManager) mContext
            .getSystemService(Context.AUDIO_SERVICE);
}

addSound method

public synchronized void addSound(int Index, int SoundID) {
    mSoundPoolMap.put(Index, mSoundPool.load(mContext, SoundID, 1));

    synchronized(this) {
        try {
            this.wait(1000) ;
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}

SoundManager implements OnLoadCompleteListener

@Override
public void onLoadComplete(SoundPool arg0, int arg1, int arg2) {
    synchronized (this) {
        this.notifyAll();
    }
}

I thought it was a load issue, so I added a OnLoadCompleteListener, but still the 2nd sound loaded fails to work.

  • 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-13T20:23:24+00:00Added an answer on June 13, 2026 at 8:23 pm

    To fix this I had to change the mp3 file, and it worked. Magically the mp3 file works on media player of Android, also on the mac. But for some reason this crazy change to a new mp3 was the only way to fix it. Many SO questions have this solution too.

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

Sidebar

Related Questions

Facing some issue in Talend Admin Console, the jobs that are running from IDE
Facing a problem, it seems my data stored in SQL Server does not stored
Not too sure how I should properly describe the issue, but what I'm facing
I am facing a weird issue and not sure whether it's jquery or combination
I'm facing the following issue. I have a view with a UINavigationBar (not NavController)
I am facing a JSON issue and do not know to approach it. I
I am facing a strange issue. I create a simple PhoenGap app, that loads
Here is an issue I've confronted in multiple user-facing applications: a program contains components
I am showing an alert on UILongPressGestureRecognizer, the issue I am facing is that
I am facing an issue in IE7 only while passing an a dynamic value

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.