Sound Effects Slow Down the Frame Rate in cocos2d-x?

Hi, I just wondering if this is a known issue where playing sound effects in cocos2d-x application will slow down the frame rate?

I notice that the frame rate reduce drastically when multiple sound effects play at the same time, either same sound or different or playing the sound effects continuously.

Each time the sound effects play I can see the frame rate drops down, just for a split second when the effects are played.

I am using mp3 format as my audio file.

Is there a way to fix this issue, is it something to do with audio format?
I’ve tried wav but no improvement.

Hope somebody with the same experience can help me.

Thanks.

Farhan

Hi,How many effects played in the same time?

Try using …
CocosDenshion::SimpleAudioEngine::sharedEngine()->preloadEffect( “yoursample.wav” );
…to pre-load the effect before your game starts, you only need to do this once for each sample.

Other than that edit your sound effects so they are 22Khz, your can try mono too. And use WAV on iOS, ogg on Android. Audacity is a decent sound effects editor if you need a free one.

@Ryeeeeee wrote:

Hi,How many effects played in the same time?

Like hundreds of them LOL
Is that OK? I guessI should add restriction/limits.