mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-21 15:56:58 +02:00
Resampler: Improve stability when ratio is 1.
This commit is contained in:
+2
-2
@@ -59889,8 +59889,8 @@ static ma_result ma_linear_resampler_set_rate_internal(ma_linear_resampler* pRes
|
|||||||
where we could have a singularity due to `sin(2*pi * cutoff/rate) = sin(pi) = 0`. I'm going to apply
|
where we could have a singularity due to `sin(2*pi * cutoff/rate) = sin(pi) = 0`. I'm going to apply
|
||||||
a small clamp in an attempt to avoid hitting this case.
|
a small clamp in an attempt to avoid hitting this case.
|
||||||
*/
|
*/
|
||||||
lpfCutoffFrequency = ma_min(lpfCutoffFrequency, 0.5 * minSampleRate * (1.0 - 1e-6));
|
lpfCutoffFrequency = ma_min(lpfCutoffFrequency, 0.5 * minSampleRate * (1.0 - 1e-5));
|
||||||
lpfCutoffFrequency = ma_max(lpfCutoffFrequency, minSampleRate * 1e-6);
|
lpfCutoffFrequency = ma_max(lpfCutoffFrequency, minSampleRate * 1e-5);
|
||||||
|
|
||||||
/* We now need to update our LPF parameters. */
|
/* We now need to update our LPF parameters. */
|
||||||
lpfCount = pResampler->lpfOrder / 2;
|
lpfCount = pResampler->lpfOrder / 2;
|
||||||
|
|||||||
Reference in New Issue
Block a user