Android API : The SoundPool class manages and plays audio resources for applications
Questions tagged [soundpool]
594 questions
79
votes
3 answers
How bad is Android SoundPool? What alternative to use?
I was looking at Android's SoundPool as a mechanism to implement sound effects in my generic game development library. It seemed ideal.
But a little bit of research indicates that there all kinds of bugs in SoundPool. Are the bugs in SoundPool still…

Andrew Russell
- 26,924
- 7
- 58
- 104
55
votes
5 answers
Play sound using soundpool example
I would like to learn how to use soundpool method. I would like you to show me a very simple example that run 2 sounds.

Sally Gomez
- 554
- 1
- 4
- 9
41
votes
9 answers
AudioFlinger could not create track. status: -12
I am programming for android 2.2 and am trying to using the
SoundPool class to play several sounds simultaneously but at what feel like random times sound will stop coming out of the speakers.
for each sound that would have been played this is…

user1599837
- 411
- 1
- 4
- 4
40
votes
5 answers
AudioTrack, SoundPool or MediaPlayer, which should I use?
Should I use AudioTrack, SoundPool or MediaPlayer if I need to be able to:
play multiple audio files, with different duration, like 5 to 30 seconds.
set the volume independently for right / left channel.
apply sound effects, like reverb /…

Fede
- 1,656
- 4
- 24
- 42
24
votes
8 answers
Soundpool sample not ready
I have a .wav file that I'd like to use across my game, currently I am loading the sound in onCreate() of each activity in the game.
soundCount = soundpool.load(this,R.raw.count, 1);
The sound will be played once the activity starts.
…

SteD
- 13,909
- 12
- 65
- 76
24
votes
5 answers
Android SoundPool: get notified when end of played
This sound so simple that I can't figure out why I can't find the answer lol
I have a working sound pool class (thanks to a tutorial and some tweaking I did), and it works fine.
the problem now is that I want to be able to change my background…

Jason Rogers
- 19,194
- 27
- 79
- 112
24
votes
1 answer
stream volume in SoundPool vs volume in AudioManager
I am so confused...
SoundPool.play(int soundID, float leftVolume, float rightVolume, int priority, int loop, float rate)
volume here is from 0.0 to 1.0
Tutorials I've seen recommend to calculate stream volume as:
AudioManager mgr = (AudioManager)…

mishkin
- 5,932
- 8
- 45
- 64
24
votes
5 answers
Soundpool plays only first 5 secs of file. Why?
I use Soundpool in my app, so far it works good, but I do have a wav file which is 10 secs. Unfortunately, soundpool plays only the first 5 secs. How to make soundpool to play the whole track? I have converted wav to -- ogg and mp3 still the same…

Daler
- 1,205
- 3
- 18
- 39
19
votes
7 answers
AudioFlinger could not create track, status: -12; Error creating AudioTrack
I am having a problem With SoundPool as it refuses to work with my .ogg files. I am getting this error:
AudioFlinger could not create track, status: -12
Error creating AudioTrack
I've found a thread concerning this and the (possible) answer…

c0dehunter
- 6,412
- 16
- 77
- 139
17
votes
2 answers
Android : How to change Playback Rate of music using OpenSL ES
I am working on a music player in which I need to change tempo (playback speed of music) without changing the pitch.
I'm not able to find any native android class to do so. I tried SoundPool but it doesn't work with large music files and it also…

Vipul Purohit
- 9,807
- 6
- 53
- 76
16
votes
2 answers
SoundPool error: no more track names available
I'm having troubles with the soundpool class. Here it goes:
In my game app (music app btw) I need to reproduce at least 32 short sounds at the same time, so I declare my soundpool like that:
private SoundPool sp;
sp = new SoundPool(128,…

Carles
- 451
- 5
- 16
16
votes
0 answers
Soundpool load sound A component of name 'OMX.qcom.audio.decoder.aac' already exists, ignoring this one
I have implemented load all sounds in Application onCreate method in background. But when i load sound it gives error like this:
E/OMXMaster: A component of name 'OMX.qcom.audio.decoder.aac' already exists, ignoring this one.
What is problem…

nAkhmedov
- 3,522
- 4
- 37
- 72
15
votes
2 answers
set Audio Attributes in SoundPool.Builder class for API 21
I am following an Android Programming video lecture series which was designed in the pre-API 21 times. Hence it tells me to create a SoundPool variable in the following manner.
SoundPool sp = new SoundPool(5, AudioManager.STREAM_MUSIC,…

Pranit Bankar
- 453
- 1
- 7
- 21
14
votes
3 answers
What is the best way to get an audio file duration in Android?
I'm using a SoundPool to play audio clips in my app. All is fine but I need to know when the clip playback has finished.
At the moment I track it in my app by obtaining the duration of each clip using a MediaPlayer instance. That works fine but it…

Gilead
- 1,516
- 2
- 18
- 26
14
votes
1 answer
Android L SoundPool.load() regression
On Android L - the latest developer preview (Nexus 5), there seems to be a regression in the SoundPool.load() method which takes >5 seconds to load a sample (<100kb), where samples were loaded on pre-L systems instantly with the very same code.
I…

Petr Nalevka
- 1,579
- 1
- 10
- 18