forked from MoonsideGames/FAudioGMS
clamp filter frequency params
parent
6c182a6de2
commit
e767dc4b0b
|
@ -539,7 +539,7 @@ static void FAudioGMS_INTERNAL_SoundInstance_SetLowPassFilter(FAudioGMS_SoundIns
|
||||||
{
|
{
|
||||||
FAudioFilterParameters p;
|
FAudioFilterParameters p;
|
||||||
p.Type = FAudioLowPassFilter;
|
p.Type = FAudioLowPassFilter;
|
||||||
p.Frequency = lowPassFilter;
|
p.Frequency = SDL_max(0.0, SDL_min(1.0, lowPassFilter));
|
||||||
p.OneOverQ = 1.0f / Q;
|
p.OneOverQ = 1.0f / Q;
|
||||||
|
|
||||||
FAudioVoice_SetFilterParameters(instance->handle, &p, 0);
|
FAudioVoice_SetFilterParameters(instance->handle, &p, 0);
|
||||||
|
@ -561,7 +561,7 @@ static void FAudioGMS_INTERNAL_SoundInstance_SetHighPassFilter(FAudioGMS_SoundIn
|
||||||
{
|
{
|
||||||
FAudioFilterParameters p;
|
FAudioFilterParameters p;
|
||||||
p.Type = FAudioHighPassFilter;
|
p.Type = FAudioHighPassFilter;
|
||||||
p.Frequency = highPassFilter;
|
p.Frequency = SDL_max(0.0, SDL_min(1.0, highPassFilter));
|
||||||
p.OneOverQ = 1.0f / Q;
|
p.OneOverQ = 1.0f / Q;
|
||||||
|
|
||||||
FAudioVoice_SetFilterParameters(instance->handle, &p, 0);
|
FAudioVoice_SetFilterParameters(instance->handle, &p, 0);
|
||||||
|
@ -583,7 +583,7 @@ static void FAudioGMS_INTERNAL_SoundInstance_SetBandPassFilter(FAudioGMS_SoundIn
|
||||||
{
|
{
|
||||||
FAudioFilterParameters p;
|
FAudioFilterParameters p;
|
||||||
p.Type = FAudioBandPassFilter;
|
p.Type = FAudioBandPassFilter;
|
||||||
p.Frequency = bandPassFilter;
|
p.Frequency = SDL_max(0.0, SDL_min(1.0, bandPassFilter));
|
||||||
p.OneOverQ = 1.0f / Q;
|
p.OneOverQ = 1.0f / Q;
|
||||||
|
|
||||||
FAudioVoice_SetFilterParameters(instance->handle, &p, 0);
|
FAudioVoice_SetFilterParameters(instance->handle, &p, 0);
|
||||||
|
|
Loading…
Reference in New Issue