3

whenever I try to loop a sound using CocosDenshion with cocos2d-x, I get the following error: my error

I'm using stable cocos2d-2.0-x-2.0.2, and my code is:

CocosDenshion::SimpleAudioEngine::sharedEngine()->playEffect("sound/sound_ocean_ambmusic.ogg", true);

This happens on both my phone (Samsung Galaxy S III, verizon) and the android emulator, both version 4.0, ICS.

What can I do?

Eli Lipsitz
  • 531
  • 1
  • 7
  • 19
  • not quite sure. but I will suggest that try another piece of very short mp3 files. if the new one works, at least it is not the engine problem. – m.ding Sep 02 '12 at 23:14
  • I'm using oggs, but I'll try a very short mp3 and a short ogg. – Eli Lipsitz Sep 03 '12 at 03:18
  • I just tried with a smaller sound, and it worked. How can I find out the limit for looping? The one I'm trying to loop is only 30.3 KB, and 4 seconds long. – Eli Lipsitz Sep 03 '12 at 14:49
  • Just tried again and it works with a sound that's even larger...I'm starting to think it's the actual ogg file. (or just sound in general) – Eli Lipsitz Sep 03 '12 at 14:51
  • then it might be the problem of the sound :P at least you can solve it by converting the sound to other format. – m.ding Sep 03 '12 at 23:03

2 Answers2

1

I have the same error. What helped me?

When every time you play sound log what sound do you want to play then check is this file maybe to big my was 30 KB (so i cut it to 17 KB). I use .ogg

Next try to modify Android Cocos2dxSound and add there another SoundPool or decresse your active streams to 6 meybe.

Gelldur
  • 11,187
  • 7
  • 57
  • 68
0

Soundpool can not handle file size larger then 1 MB

Kirtikumar A.
  • 4,140
  • 43
  • 43