My button is playing a sound from within a SoundPool (http://developer.and.../SoundPool.html) when it is clicked, like this:
public void onclick(View v) {
// Get the users sound settings
AudioManager audioManager = (AudioManager)getSystemService(AUDIO_SERVICE);
float actualVolume = audioManager.getStreamVolume(AudioManager.STREAM_MUSIC);
float maxVolume = audioManager.getStreamMaxVolume(AudioManager.STREAM_MUSIC);
float volume = actualVolume / maxVolume;
// Are all sounds loaded?
if(soundsLoaded) {
soundPool.play(soundList.get(0), volume, volume, 1, 0, 1f);
} else {
Toast.makeText(this, "Please wait for all the sounds to load.", Toast.LENGTH_SHORT);
}
}
My problem is that the sound that's playing (about half a second long) is really choppy. I have tried different compressed formats(ogg, flac, mp3) as well as wav, but they all sound really bad. What am I doing wrong? Help is greattly appreciated!
This post has been edited by oha055: 02 May 2012 - 11:50 AM

New Topic/Question
Reply



MultiQuote






|