diff options
author | Chris Robinson <[email protected]> | 2013-05-27 19:14:02 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2013-05-27 19:14:02 -0700 |
commit | feeec3433377d46f71771c3930e5e00bf9834feb (patch) | |
tree | 7f35880242639f791f65753d341e923b73e877c6 /OpenAL32/alFilter.c | |
parent | bcf4842eb3f226faa83e2343e2492dda31386c20 (diff) |
Use ALfilterState for the source direct and send filters
Diffstat (limited to 'OpenAL32/alFilter.c')
-rw-r--r-- | OpenAL32/alFilter.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/OpenAL32/alFilter.c b/OpenAL32/alFilter.c index 5bef87fd..550c99f5 100644 --- a/OpenAL32/alFilter.c +++ b/OpenAL32/alFilter.c @@ -343,6 +343,17 @@ void ALfilterState_setParams(ALfilterState *filter, ALfilterType type, ALfloat g /* Calculate filter coefficients depending on filter type */ switch(type) { + case ALfilterType_LowPass: + alpha = sinf(w0) / 2.0f * sqrtf((gain + 1.0f/gain) * + (1.0f/0.75f - 1.0f) + 2.0f); + filter->b[0] = (1.0f - cosf(w0)) * 0.5f; + filter->b[1] = 1.0f - cosf(w0); + filter->b[2] = (1.0f - cosf(w0)) * 0.5f; + filter->a[0] = 1.0f + alpha; + filter->a[1] = -2.0f*cosf(w0); + filter->a[2] = 1.0f - alpha; + break; + case ALfilterType_HighShelf: alpha = sinf(w0) / 2.0f * sqrtf((gain + 1.0f/gain) * (1.0f/0.75f - 1.0f) + 2.0f); |