@Steve Oldmeadow Thanks for your answer.
First, about the kAMM_PlayAndRecord it was weird for me too. I went to the CDAudioManager implementation and tried ALL the modes and the only one that allow the iPod music coexist with my game sounds was that mode, it was totally the opposite to what the comments of the modes said as you mentioned in your post, but for some strange reason it works only that way.
Now, for the other point. I've inserted this line of code at the end of the applicationDidFinishLaunching:(UIApplication*)application so it look like this at the end:
// Removes the startup flicker
[self removeStartupFlicker];
//Para reproducir el audio del juego junto con cualquier aplicación de audio que se esté usando en el dispositivo
[[CDAudioManager sharedManager] setMode:kAMM_PlayAndRecord];
//Handler para que la música se resuma automáticamente después de una interrupción de la app
[[CDAudioManager sharedManager] setResignBehavior:kAMRBStopPlay autoHandle:YES];
// Run the intro Scene
[[CCDirector sharedDirector] runWithScene: [GNLoadingScene sceneWithTargetScene:TargetSceneMainMenu]];
It still doesn't work. I debugged the code and when I press the HOME button (to resume the app) the notification event inside CDAudioManager is correctly called:
- (void) applicationDidBecomeActive {
And it reaches this lines, which is where the sound should be resumed:
if (audioSource->systemPaused) {
[audioSource resume];
audioSource->systemPaused = NO;
}
But nothing happens!
Thanks for any additional help you can give me, I don't know what's wrong.