diff --git a/src/audio/al-util.h b/src/audio/al-util.h index 9f74ff4e..98715de3 100644 --- a/src/audio/al-util.h +++ b/src/audio/al-util.h @@ -181,11 +181,11 @@ namespace Source break; case VolumeScale::Db35: if (value > FLT_EPSILON) { - value = std::powf(10., -(35. / 20.) * (1. - value)); + value = std::powf(10.0f, -(35.0f / 20.0f) * (1.0f - value)); } break; } - alSourcef(id.al, AL_GAIN, value); + alSourcef(id.al, AL_GAIN, value * 0.8f); } inline void setPitch(Source::ID id, float value) @@ -269,6 +269,5 @@ inline ALenum chooseALFormat(int sampleSize, int channelCount) #define AUDIO_SLEEP 10 #define STREAM_BUF_SIZE 32768 -#define GLOBAL_VOLUME 0.8f #endif // ALUTIL_H diff --git a/src/audio/audiostream.cpp b/src/audio/audiostream.cpp index 606016ee..be0b9b3d 100644 --- a/src/audio/audiostream.cpp +++ b/src/audio/audiostream.cpp @@ -260,7 +260,7 @@ float AudioStream::playingOffset() void AudioStream::updateVolume() { - float vol = GLOBAL_VOLUME; + float vol = 1.0f; for (size_t i = 0; i < VolumeTypeCount; ++i) vol *= volumes[i]; diff --git a/src/audio/soundemitter.cpp b/src/audio/soundemitter.cpp index 203576a3..f1452cf6 100644 --- a/src/audio/soundemitter.cpp +++ b/src/audio/soundemitter.cpp @@ -172,7 +172,7 @@ void SoundEmitter::play(const std::string &filename, if (switchBuffer) AL::Source::attachBuffer(src, buffer->alBuffer); - AL::Source::setVolume(src, _volume * GLOBAL_VOLUME, AL::Source::Linear); + AL::Source::setVolume(src, _volume, AL::Source::Linear); AL::Source::setPitch(src, _pitch); AL::Source::play(src);