Warn that trying to resample 44.1kHz to 44.1kHz is a stupid thing to do.

This commit is contained in:
JasonLG1979 2023-06-26 18:00:39 -05:00
parent c29ec3f473
commit 4b081b1365

View file

@ -226,10 +226,14 @@ impl SampleRate {
// Dummy values to satisfy // Dummy values to satisfy
// the match statement. // the match statement.
// 44.1kHz will be bypassed. // 44.1kHz will be bypassed.
Hz44100 => ResampleSpec { Hz44100 => {
resample_factor_reciprocal: 1.0, warn!("Resampling 44.1kHz to 44.1kHz is just a really CPU intensive no-op, you should not be doing it");
interpolation_output_size: RESAMPLER_INPUT_SIZE,
}, ResampleSpec {
resample_factor_reciprocal: 1.0,
interpolation_output_size: RESAMPLER_INPUT_SIZE,
}
}
Hz48000 => ResampleSpec { Hz48000 => ResampleSpec {
resample_factor_reciprocal: HZ48000_RESAMPLE_FACTOR_RECIPROCAL, resample_factor_reciprocal: HZ48000_RESAMPLE_FACTOR_RECIPROCAL,
interpolation_output_size: HZ48000_INTERPOLATION_OUTPUT_SIZE, interpolation_output_size: HZ48000_INTERPOLATION_OUTPUT_SIZE,