0

For some reason, at first, simpleAudioEngine worked to play all sounds, but then, after a while, they stop working. I am using the simple audio engine to play sound effects that are under 1 second long and are all mp3s, while playing music using AVAudioPlayer. This is the code that I use for the simpleAudioEngine:

//During initialization
[[SimpleAudioEngine sharedEngine] preloadeffect:@"jump.mp3"];
//When effect needs to be played
[[SimpleAudioEngine sharedEngine] playeffect:@"jump.mp3"];
S.H.
  • 2,833
  • 3
  • 26
  • 28
adam1121
  • 7
  • 6
  • Don't use mp3 for sfx, use wav or caf. Mp3 have to be decoded by the CPU because only one mp3 file can by decoded by the hardware decoder. – CodeSmile Aug 21 '13 at 19:30
  • I have tried to use .wav files too, but for some reason they weren't working (and only those .wav files stopped, I had a few .aiff and an .mp3 that continued to work), so I converted them, but that didn't fix anything – adam1121 Aug 21 '13 at 23:00
  • wav/caf need to be mono - if they're stereo they won't play at all – CodeSmile Aug 22 '13 at 18:16
  • change the file to 16bit, the wav files... maybe that helps. And also the preloadeffect remove it when using wav files. The wav its already uncompressed no need to preload. – S.H. Oct 12 '13 at 02:45

0 Answers0