diff --git a/CocosDenshion/bada/SimpleAudioEngine.cpp b/CocosDenshion/bada/SimpleAudioEngine.cpp index c14e693228..01a9d63ae2 100644 --- a/CocosDenshion/bada/SimpleAudioEngine.cpp +++ b/CocosDenshion/bada/SimpleAudioEngine.cpp @@ -397,7 +397,7 @@ void SimpleAudioEngine::setBackgroundMusicVolume(float volume) if (s_pBackPlayer != NULL) { - s_pBackPlayer->SetVolume(ceil(volume)); + s_pBackPlayer->SetVolume(ceil(volume*99)); } s_fBackgroundMusicVolume = volume; } @@ -423,7 +423,7 @@ void SimpleAudioEngine::setEffectsVolume(float volume) { if (it->second != NULL) { - it->second->SetVolume(ceil(volume)); + it->second->SetVolume(ceil(volume*99)); } } s_fEffectsVolume = volume; @@ -446,13 +446,7 @@ unsigned int SimpleAudioEngine::playEffect(const char* pszFilePath, bool bLoop/* AppLog("CCAudioOut instance must not be NULL, id = %d", p->first); return 0; } - p->second->SetVolume((int) (s_fEffectsVolume * 99)); - int volume = p->second->GetVolume(); - - if (s_fEffectsVolume > 0.0f && volume == 0) - { - p->second->SetVolume(1); - } + p->second->SetVolume(ceil(s_fEffectsVolume * 99)); if (AUDIOOUT_STATE_PLAYING == p->second->GetState()) { diff --git a/tests/tests/CocosDenshionTest/CocosDenshionTest.cpp b/tests/tests/CocosDenshionTest/CocosDenshionTest.cpp index 749fd73132..c60525e25f 100644 --- a/tests/tests/CocosDenshionTest/CocosDenshionTest.cpp +++ b/tests/tests/CocosDenshionTest/CocosDenshionTest.cpp @@ -151,19 +151,19 @@ void CocosDenshionTest::menuCallback(CCObject * pSender) break; // add bakcground music volume case 10: - SimpleAudioEngine::sharedEngine()->setBackgroundMusicVolume(SimpleAudioEngine::sharedEngine()->getBackgroundMusicVolume() + 0.1); + SimpleAudioEngine::sharedEngine()->setBackgroundMusicVolume(SimpleAudioEngine::sharedEngine()->getBackgroundMusicVolume() + 0.1f); break; // sub backgroud music volume case 11: - SimpleAudioEngine::sharedEngine()->setBackgroundMusicVolume(SimpleAudioEngine::sharedEngine()->getBackgroundMusicVolume() - 0.1); + SimpleAudioEngine::sharedEngine()->setBackgroundMusicVolume(SimpleAudioEngine::sharedEngine()->getBackgroundMusicVolume() - 0.1f); break; // add effects volume case 12: - SimpleAudioEngine::sharedEngine()->setEffectsVolume(SimpleAudioEngine::sharedEngine()->getEffectsVolume() + 0.1); + SimpleAudioEngine::sharedEngine()->setEffectsVolume(SimpleAudioEngine::sharedEngine()->getEffectsVolume() + 0.1f); break; // sub effects volume case 13: - SimpleAudioEngine::sharedEngine()->setEffectsVolume(SimpleAudioEngine::sharedEngine()->getEffectsVolume() - 0.1); + SimpleAudioEngine::sharedEngine()->setEffectsVolume(SimpleAudioEngine::sharedEngine()->getEffectsVolume() - 0.1f); break; case 14: SimpleAudioEngine::sharedEngine()->pauseEffect(m_nSoundId);