0

I'm using this method to play sounds:

int streamVolume = mAudioManager.getStreamVolume(AudioManager.STREAM_MUSIC);
mSoundPool.play(mSoundPoolMap.get(index), streamVolume, streamVolume, 1, 0, 1f); 

I have not problem playing short sounds. But if I play music that takes longer, it interrupts at the 4,5 second. As per usual no error or notification is shown.

alex
  • 301
  • 3
  • 13
  • Possible duplicate of [Soundpool plays only first 5 secs of file. Why?](http://stackoverflow.com/questions/13377604/soundpool-plays-only-first-5-secs-of-file-why) – tripleee Jun 30 '16 at 03:05
  • strangely the bash scripters and sql masters are the most active here – alex Jun 30 '16 at 03:42

2 Answers2

0

Assuming you are using a SoundPool this is pretty much the basic behaviour, its intended for small clips only.

Soundpool plays only first 5 secs of file. Why?

I had the same issue and if you want to play longer sounds you will need to use the MediaPlayer

Community
  • 1
  • 1
DokutoMekki
  • 491
  • 4
  • 17
0

Try reducing the sample rate from 44khz to 32khz or lower.

Undo
  • 25,519
  • 37
  • 106
  • 129
sris
  • 1