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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T01:58:08+00:00 2026-05-19T01:58:08+00:00

I recently acquired a Samsung Galaxy S, Android 2.1 update and after running my

  • 0

I recently acquired a Samsung Galaxy S, Android 2.1 update and after running my app I found that some of the sound effects play twice concurrently. This is odd because the sound effects which exhibit this behaviour seem random – on some instances some will play twice on others they will play once as expected. This bug has not been reported on any other hardware platform for my app. I have only seen one reported incident of this on this site and the person switched to use MediaPlayer however I really want to get a remedy for this.

When the app is run it initiates the Soundpool as follows,

public static final int SOUND_EXPLOSION = 1;
public static final int SOUND_CLEAR = 2;
public static final int SOUND_CLICK = 3;
public static final int SOUND_MAGIC = 4;
public static final int SOUND_ROCKET = 5;
public static final int SOUND_MELT = 6;

private SoundPool soundPool;
private AudioManager mgr;
private HashMap<Integer, Integer> soundPoolMap;

private void initSounds()
{   
     soundPool = new SoundPool(4, AudioManager.STREAM_MUSIC, 100);

     soundPoolMap = new HashMap<Integer, Integer>();

     soundPoolMap.put(SOUND_EXPLOSION, soundPool.load(getContext(), R.raw.explosion3, 1));
     soundPoolMap.put(SOUND_CLEAR, soundPool.load(getContext(), R.raw.pop, 1));
     soundPoolMap.put(SOUND_CLICK, soundPool.load(getContext(), R.raw.click, 1));
     soundPoolMap.put(SOUND_MAGIC, soundPool.load(getContext(), R.raw.swoosh, 1));
     soundPoolMap.put(SOUND_ROCKET, soundPool.load(getContext(), R.raw.rocket, 1));
     soundPoolMap.put(SOUND_MELT, soundPool.load(getContext(), R.raw.melt3, 1));
     mgr = (AudioManager)getContext().getSystemService(Context.AUDIO_SERVICE); 
}

Sound fx are then played by calling the following sub, (PlaySound is a global toggled by the user options)

public void playSound(int sound)
{


 if (PlaySound == true)
 {
     Log.w("playSound","Playing Sound" + sound);          
     float streamVolumeCurrent = mgr.getStreamVolume(AudioManager.STREAM_MUSIC);   
     float streamVolumeMax = mgr.getStreamMaxVolume(AudioManager.STREAM_MUSIC);       
     float volume = streamVolumeCurrent / streamVolumeMax; 
     soundPool.play(soundPoolMap.get(sound), volume, volume, 1, 0, 1f);
 }

} 

As you can see there is a log call which I used to see how many times the sub had been called although this revealed that when the bug occurs the routine is only called once when the sound is heard twice from the device.

I have also one last sub which is called when the surface view is destroyed to tidy up.

public void ReleaseSounds()
{
  if (soundPool != null)
  {

   soundPool.release();
   soundPool = null;

  }
}

Has anyone else had this issue, if so how did you resolve it? Any help on this would be greatly appreciated,

Many thanks in advance

  • 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-19T01:58:08+00:00Added an answer on May 19, 2026 at 1:58 am

    Converting sound files to OGG in the raw folder seems to have resolved this bug – I have not seen a repeat of it since.

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

Sidebar

Related Questions

I have recently acquired a ViewSonic G Tablet running Android 2.2 for the development
Recently I'm doing some work on RTMP streaming, that is using Flowplayer to integrate
Recently, we had released an app. Before we releasing, we tested it on Samsung
Recently I have been refactoring some of my C# code and I found a
I am a C# Developer, and I recently acquired a project at work that
I recently saw some Perl code that confused me. I took out all of
Recently there was some upgrade happened from frame work 2.0 to 4.0, so after
Recently I found about this tool easy_install that help me to easy install additional
Recently I found some simple source code of a bootloader.The following is the simple
Recently I noticed (after others have extended the project) that the compile time significantly

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.