cocos2d-x背景音乐';s的卷无法更改

cocos2d-x背景音乐';s的卷无法更改,cocos2d-x,Cocos2d X,当我使用cocos2d-x编写程序时,我发现我无法更改音乐的音量。演示中都没有。所以我打开了源文件。我发现函数setBackgroundMusicVolume为空,函数getBackgroundMusicVolume只返回1.0f。 我想知道为什么。代码如下所示: float SimpleAudioEngine::getBackgroundMusicVolume() { return 1.0; } void SimpleAudioEngine::setBackgroundMusicVo

当我使用cocos2d-x编写程序时,我发现我无法更改音乐的音量。演示中都没有。所以我打开了源文件。我发现函数setBackgroundMusicVolume为空,函数
getBackgroundMusicVolume
只返回1.0f。 我想知道为什么。代码如下所示:

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

void SimpleAudioEngine::setBackgroundMusicVolume(float volume)
{
}

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

void SimpleAudioEngine::setEffectsVolume(float volume)
{
}

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

设置背景音乐音量效果

CocosDenshion::SimpleAudioEngine::getInstance()->setBackgroundMusicVolume(1.0);

它在最后一个稳定的cocos2d-xv2上工作。您使用的版本是什么?cocos2d-x 2.04。我在cocos2d-x2.14中看到了源文件,它是same@vediVolume0.0到1.0之间的值也会浮动