clamp filter frequency params

mastering_effects
cosmonaut 2021-10-28 15:07:30 -07:00
parent 6c182a6de2
commit e767dc4b0b
1 changed files with 3 additions and 3 deletions

View File

@ -539,7 +539,7 @@ static void FAudioGMS_INTERNAL_SoundInstance_SetLowPassFilter(FAudioGMS_SoundIns
{
FAudioFilterParameters p;
p.Type = FAudioLowPassFilter;
p.Frequency = lowPassFilter;
p.Frequency = SDL_max(0.0, SDL_min(1.0, lowPassFilter));
p.OneOverQ = 1.0f / Q;
FAudioVoice_SetFilterParameters(instance->handle, &p, 0);
@ -561,7 +561,7 @@ static void FAudioGMS_INTERNAL_SoundInstance_SetHighPassFilter(FAudioGMS_SoundIn
{
FAudioFilterParameters p;
p.Type = FAudioHighPassFilter;
p.Frequency = highPassFilter;
p.Frequency = SDL_max(0.0, SDL_min(1.0, highPassFilter));
p.OneOverQ = 1.0f / Q;
FAudioVoice_SetFilterParameters(instance->handle, &p, 0);
@ -583,7 +583,7 @@ static void FAudioGMS_INTERNAL_SoundInstance_SetBandPassFilter(FAudioGMS_SoundIn
{
FAudioFilterParameters p;
p.Type = FAudioBandPassFilter;
p.Frequency = bandPassFilter;
p.Frequency = SDL_max(0.0, SDL_min(1.0, bandPassFilter));
p.OneOverQ = 1.0f / Q;
FAudioVoice_SetFilterParameters(instance->handle, &p, 0);