2

When I use cocos2d-x to write a program, I found I could not change the volume of the music. Neither in the demo. So I open the source file. I found that the function setBackgroundMusicVolume is empty, and the function getBackgroundMusicVolume just return 1.0f. I want to know why. The code is showed below:

float SimpleAudioEngine::getBackgroundMusicVolume()
{
    return 1.0;
}

void SimpleAudioEngine::setBackgroundMusicVolume(float volume)
{
}

float SimpleAudioEngine::getEffectsVolume()
{
    return 1.0;
}

void SimpleAudioEngine::setEffectsVolume(float volume)
{
}
4

2 回答 2

1

设置背景音乐音量效果

CocosDenshion::SimpleAudioEngine::getInstance()->setBackgroundMusicVolume(1.0);
于 2015-07-08T05:43:02.673 回答
0

你在看什么平台?不同的平台会有自己的实现;您可以相应地在“CocosDenshion”文件夹中看到这些实现。

于 2013-10-29T09:54:32.060 回答