Last active
September 29, 2015 01:43
-
-
Save nicnocquee/9fe35da71f4a24c32700 to your computer and use it in GitHub Desktop.
Cocos2d-x sound effect while letting user's song playing in iOS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// AppController.mm | |
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { | |
[[CDAudioManager sharedManager] setMode:kAMM_FxPlusMusicIfNoOtherAudio]; | |
return YES; | |
} | |
// in other file | |
#include "audio/include/SimpleAudioEngine.h" | |
void SomeClass::someMethod() { | |
CocosDenshion::SimpleAudioEngine::getInstance()->playEffect("res/sfx.mp3"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment