cocos2d-x Macro for iOS and Android
Following MACRO can make different behavior between iOS and Android:
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) #define MUSIC_FILE "background.ogg" #else #define MUSIC_FILE "background.caf" #endif audio->playBackgroundMusic(MUSIC_FILE, true);