From ea9fb140fad0619bb12db39271bb65c6072562d8 Mon Sep 17 00:00:00 2001 From: Dale Stammen Date: Sat, 22 Mar 2014 06:13:02 -0700 Subject: [PATCH] no mp3 support for wp8 --- cocos/editor-support/cocostudio/CCComAudio.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cocos/editor-support/cocostudio/CCComAudio.cpp b/cocos/editor-support/cocostudio/CCComAudio.cpp index e232d07569..04d4efd235 100644 --- a/cocos/editor-support/cocostudio/CCComAudio.cpp +++ b/cocos/editor-support/cocostudio/CCComAudio.cpp @@ -97,6 +97,15 @@ bool ComAudio::serialize(void* r) CC_BREAK_IF(resType != 0); if (strcmp(className, "CCBackgroundAudio") == 0) { +#if (CC_TARGET_PLATFORM == CC_PLATFORM_WP8) + // no MP3 support for CC_PLATFORM_WP8 + std::string::size_type pos = filePath.find(".mp3"); + if (pos == filePath.npos) + { + continue; + } + filePath.replace(pos, filePath.length(), ".wav"); +#endif preloadBackgroundMusic(filePath.c_str()); bool loop = DICTOOL->getIntValue_json(*v, "loop") != 0? true:false; setLoop(loop);