Skip to content

Commit

Permalink
- enable OpenAL's sound volume normalizer.
Browse files Browse the repository at this point in the history
  • Loading branch information
coelckers committed Oct 27, 2020
1 parent 0b7fb45 commit fb0a40e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/common/audio/sound/oalsound.cpp
Expand Up @@ -556,6 +556,8 @@ OpenALSoundRenderer::OpenALSoundRenderer()
ALC.EXT_disconnect = !!alcIsExtensionPresent(Device, "ALC_EXT_disconnect");
ALC.SOFT_HRTF = !!alcIsExtensionPresent(Device, "ALC_SOFT_HRTF");
ALC.SOFT_pause_device = !!alcIsExtensionPresent(Device, "ALC_SOFT_pause_device");
ALC.SOFT_pause_device = !!alcIsExtensionPresent(Device, "ALC_SOFT_pause_device");
ALC.SOFT_output_limiter = !!alcIsExtensionPresent(Device, "ALC_SOFT_output_limiter");

const ALCchar *current = NULL;
if(alcIsExtensionPresent(Device, "ALC_ENUMERATE_ALL_EXT"))
Expand Down Expand Up @@ -592,6 +594,11 @@ OpenALSoundRenderer::OpenALSoundRenderer()
else
attribs.Push(ALC_DONT_CARE_SOFT);
}
if (ALC.SOFT_output_limiter)
{
attribs.Push(ALC_OUTPUT_LIMITER_SOFT);
attribs.Push(ALC_TRUE /* or ALC_FALSE or ALC_DONT_CARE_SOFT */);
}
// Other attribs..?
attribs.Push(0);

Expand Down
3 changes: 3 additions & 0 deletions src/common/audio/sound/oalsound.h
Expand Up @@ -48,6 +48,8 @@
#define ALC_NUM_HRTF_SPECIFIERS_SOFT 0x1994
#define ALC_HRTF_SPECIFIER_SOFT 0x1995
#define ALC_HRTF_ID_SOFT 0x1996
#define ALC_OUTPUT_LIMITER_SOFT 0x199A

typedef const ALCchar* (ALC_APIENTRY*LPALCGETSTRINGISOFT)(ALCdevice *device, ALCenum paramName, ALCsizei index);
typedef ALCboolean (ALC_APIENTRY*LPALCRESETDEVICESOFT)(ALCdevice *device, const ALCint *attribs);
#ifdef AL_ALEXT_PROTOTYPES
Expand Down Expand Up @@ -181,6 +183,7 @@ class OpenALSoundRenderer : public SoundRenderer
bool EXT_disconnect;
bool SOFT_HRTF;
bool SOFT_pause_device;
bool SOFT_output_limiter;
} ALC;
struct {
bool EXT_source_distance_model;
Expand Down

0 comments on commit fb0a40e

Please sign in to comment.