Add global mute option
This commit is contained in:
@@ -278,7 +278,7 @@ givealbuffer_common(const void *buf, const uint8_t src, const int size, const in
|
||||
|
||||
alGetSourcei(source[src], AL_BUFFERS_PROCESSED, &processed);
|
||||
if (processed >= 1) {
|
||||
const double gain = pow(10.0, (double) sound_gain / 20.0);
|
||||
const double gain = sound_muted ? 0.0 : pow(10.0, (double) sound_gain / 20.0);
|
||||
alListenerf(AL_GAIN, (float) gain);
|
||||
|
||||
alSourceUnqueueBuffers(source[src], 1, &buffer);
|
||||
|
||||
@@ -245,7 +245,7 @@ givealbuffer_common(const void *buf, IXAudio2SourceVoice *sourcevoice, const siz
|
||||
if (!initialized)
|
||||
return;
|
||||
|
||||
(void) IXAudio2MasteringVoice_SetVolume(mastervoice, pow(10.0, (double) sound_gain / 20.0),
|
||||
(void) IXAudio2MasteringVoice_SetVolume(mastervoice, sound_muted ? 0.0 : pow(10.0, (double) sound_gain / 20.0),
|
||||
XAUDIO2_COMMIT_NOW);
|
||||
XAUDIO2_BUFFER buffer = { 0 };
|
||||
buffer.Flags = 0;
|
||||
|
||||
Reference in New Issue
Block a user