I am working on a game that has coins, power ups, and death sounds. The usual for a game. My sound engineer is telling me that in order to make it sound good, I need to have a 300ms delay between all sounds so that they do not play on top of each other and make the sound louder.
E.g., if you pickup multiple coins within that 300ms I don't want to play the sound for all of them.
Here is how I am playing a randomized death sound. But how do I add a delay?
int random = rand() % 4;
switch (random) {
case 0:
CocosDenshion::SimpleAudioEngine::sharedEngine()->playEffect( enemyDeathSoundName );
break;
case 1:
CocosDenshion::SimpleAudioEngine::sharedEngine()->playEffect( enemyDeathSoundName2 );
break;
case 2:
CocosDenshion::SimpleAudioEngine::sharedEngine()->playEffect( enemyDeathSoundName3 );
break;
case 3:
CocosDenshion::SimpleAudioEngine::sharedEngine()->playEffect( enemyDeathSoundName4 );
break;
default:
break;
}
Does anyone have ideas on how this is possible?