Questions tagged [soundpool]

Android API : The SoundPool class manages and plays audio resources for applications

594 questions
7
votes
1 answer

ioctl c0044901 failed with code -1: Inappropriate ioctl for device and grantorIdx must be less than 3 error

I have a very simple Fragment which is my app's starting screen. It's basically just two buttons and when you click the PLAY button a sound is played using a SoundPool and the app navigates to another Fragment. The code is as follows: class…
Klariskao
  • 133
  • 1
  • 8
7
votes
5 answers

Playing two sounds Simutaneosly

I am trying to play two sounds simutaneosly in android.I have created two MediaPlayers and am using the code below.They are currently playing one after another.Or not exactly one after another but kinda delayed into eachother. private void…
james
  • 161
  • 1
  • 3
  • 8
7
votes
2 answers

How to Sync Sounds using SoundPool

I have been trying to get a few sounds to play at the same time; currently i'm using a shared instance of SoundPool. I would like 1, 2 or 3 sounds to be played at the exact same time with no lag. When calling SoundPool.play(...) X number of times…
7
votes
4 answers

How do I know if a sound is finished playing in android?

How do I know if a sound has finished playing? I want to play 2 sounds but I want one sound to play and then wait until the 1st sound is done before the 2nd starts. Also, if I wanted to do something else when the sound is finished like show he…
cmerrell
  • 503
  • 3
  • 7
  • 16
7
votes
0 answers

Can Android Visualizer Class be used on SoundPool object?

When using a SoundPool audio class, it definitely has some advantages over a MediaPlayer when just playing short audio clips. The two I've noticed is SoundPool is a lot faster. MediaPlayer can lag a bit on startup and it's much easier to go from one…
awbrown90
  • 71
  • 2
7
votes
2 answers

Android MediaPlayer setNextMediaPlayer() alternative

I published an app recently, and users are reporting crashes because my program included the method setNextMediaPlayer(). I now realize that this only works for API 16+, and my app supports API 8+. I was wondering if there is an alternate way of…
picklelo
  • 73
  • 1
  • 5
7
votes
2 answers

Soundpool not looping in android 4.3

I have a couple of apps in which I use soundpool to loop the sound of a ticking clock, this works fine in all previous versions of android but after upgrading to android 4.3 the sound no longer loops but just plays once. I know I can use…
user2638195
  • 71
  • 1
  • 4
7
votes
1 answer

Android's SoundPool stutters, lags, sometimes doesn't play at all

Use case I've got 68 piano samples, each approx. 174 kB, Ogg data, Vorbis audio, stereo, s16, 44100 Hz, 352 kb/s, 4 seconds. I need to simultaneously play different combinations of them (musical term: harmonic chords/intervals), e.g. 1st + 7th, 14th…
Michal Rus
  • 1,796
  • 2
  • 18
  • 27
6
votes
2 answers

Android audio : change pitch

The Android documentation for SoundPool says "the application can also alter the pitch by adjusting the playback rate in real-time for doppler or synthesis effects". So I tried to do this, using the setRate method to vary smoothly from one note to…
Patrick
  • 3,578
  • 5
  • 31
  • 53
6
votes
3 answers

android soundpool heapsize overflow

I get this error hundreds of times when I run in Debug, it doesn't seem to affect the program, but how do I get rid of it? I know it can be traced back to the SoundPool based on other posts 09-15 09:03:09.190: ERROR/AudioCache(34): Heap size…
GideonKain
  • 744
  • 1
  • 12
  • 27
6
votes
1 answer

Play Multiple audio files through ExoPlayer or some other option?

My problem: I want to load 70 sounds in my app and then want to play multiple sound(maximum 8 sound at a time). Example app is below: https://play.google.com/store/apps/details?id=net.relaxio.sleepo I try SoundPool system in my app and it give me a…
ibad ur rahman
  • 1,381
  • 4
  • 18
  • 40
6
votes
1 answer

Play three or more short sounds in exact time SoundPool(piano chord)

I have a problem, I want to start sound in the same time. I play 3-5 short sound in loop (piano sounds), and I have delay on first 1ms, on second 17ms, and so on, up to 60-90ms on last sound. I am using SoundPool. Anyone have a problem like this or…
Wrobel
  • 1,042
  • 12
  • 21
6
votes
1 answer

Android Soundpool problems

I've got an app on the Android Market and have been using the SoundPool classes for the sound effects. I've noticed that, of all the parts of the Android API, this seems to have caused me the most problems. For example: HTC Desire has problems…
Kevin
  • 1,200
  • 1
  • 11
  • 19
6
votes
2 answers

android repeatedly play a mp3 file without any gap

I want to play a mp3 file from sdcard repeatedly without any gap. I am using MediaPlayer.setlooping(true) method to repeatedly play the mp3. it works fine. But it gives a gape of few seconds between repetition. I also looking for soundPools but it…
mnsalim
  • 947
  • 6
  • 16
6
votes
1 answer

sound pool not finish playing entire file

I have two issues I would like understand. I am using soundPool for my sound effects and its working with no problem. However, when I try to play cetain file (25 sec , about 400K) it doesn't play the whole file only 3-4 seconds from it . Why and how…
Jesus Dimrix
  • 4,378
  • 4
  • 28
  • 62
1 2
3
39 40