no mp3 support for wp8

This commit is contained in:
Dale Stammen 2014-03-22 06:13:02 -07:00
parent 3834d4e80b
commit ea9fb140fa
1 changed files with 9 additions and 0 deletions

View File

@ -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);