ERROR/AudioCache(493): Heap size overflow! req size: 1052672, max size: 1048576
<p>I got Sound Error in My application, would you suggest me for right approach </p>

<p>08-23 12:43:45.560: ERROR/AudioCache(493): Heap size overflow! req size: 1052672, max size: 1048576 </p>

<p>I make A class soundManage to manage the sound and every time in new class , I make it object and try to play sound effect in the game. </p>

<pre><code>import java.util.HashMap;
import android.content.Context;
import android.media.AudioManager;
import android.media.SoundPool;
public class SoundManage {

Context mcontext;
public float volume;
public AudioManager mgr;
public SoundPool soundPool;
public HashMap&lt;Integer,Integer&gt; soundMap;

static final int SD_RIVER = 1;
static final int SD_TAP = 2;
static final int SD_ERROR = 3;
static final int SD_CLAP = 4;
static final int SD_RIOT = 5;

public SoundManage(Context ctx) {
    // TODO Auto-generated constructor stub
    mcontext = ctx;
    mgr = (AudioManager) mcontext.getSystemService(Context.AUDIO_SERVICE);
    soundPool = new SoundPool(5, AudioManager.STREAM_MUSIC, 100);
    soundMap = new HashMap&lt;Integer, Integer&gt;();
    float streamVolumeCurrent = mgr.getStreamVolume(AudioManager.STREAM_MUSIC);
    float streamVolumeMax = mgr.getStreamMaxVolume(AudioManager.STREAM_MUSIC);
    volume = streamVolumeCurrent/streamVolumeMax;

    soundMap.put(SoundManage.SD_RIVER, soundPool.load(mcontext, R.raw.river, 1));
    soundMap.put(SoundManage.SD_TAP, soundPool.load(mcontext, R.raw.tap, 1));
    soundMap.put(SoundManage.SD_ERROR, soundPool.load(mcontext, R.raw.error, 1));
    soundMap.put(SoundManage.SD_CLAP, soundPool.load(mcontext, R.raw.ap, 1));
    soundMap.put(SoundManage.SD_RIOT, soundPool.load(mcontext, R.raw.ap2, 1));

}
public void playSound(int StreamID)
{
    soundPool.play(StreamID, volume, volume, 1, 0, 1.0f);
}

public SoundPool getSoundPool()
{
    return soundPool;
}
public void destroySoundManage()
{
    soundPool.release();
    soundMap.clear();
}

 }
</code></pre>

<p>tell me for my miss tack in my procedure.</p>

<p>Thanks, </p>
