fix bug that SimpleAudioEngine can not change effect volume (#19605)

This commit is contained in:
minggo 2019-04-14 23:52:52 -07:00 committed by GitHub
parent 212abc4ea0
commit 60272f6b88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -172,7 +172,7 @@ void SimpleAudioEngine::setEffectsVolume(float volume)
*/
unsigned int SimpleAudioEngine::playEffect(const char* filePath, bool loop, float pitch, float pan, float gain)
{
return AudioEngine::play2d(filePath, loop, gain);
return AudioEngine::play2d(filePath, loop, g_SimpleAudioEngine->effectsvolume);
}
/**

View File

@ -183,9 +183,10 @@ public:
* @param gain Volume, in the range of [0..1]. The normal value is 1.
* @return The sound id.
*
* @note Full support is under development, now there are limitations:
* - no pitch effect on Samsung Galaxy S2 with OpenSL backend enabled;
* - no pitch/pan/gain on win32.
* @note Now use Audio Engine to implement SimpleAudioEngine, and Audio Engine doesn't support
* - pitch
* - pan
* - gain
*/
virtual unsigned int playEffect(const char* filePath, bool loop = false,
float pitch = 1.0f, float pan = 0.0f, float gain = 1.0f);