RustAudio / rodio

Rust audio playback library
Apache License 2.0
1.78k stars 232 forks source link

SineWave generates heavy amounts of ringing because of improper downsampling #208

Open mlindner opened 5 years ago

mlindner commented 5 years ago

This is one of the two issues found in #201.

With the fix in #202 what still occurs is when the input sinewave is 48000 (the default) and the automatically selected sound output device is using 44100 Hz and the rodio::sink or rodio::queue (fed through play_raw) are used then the output has heavy amounts of aliasing/ringing from improper downsampling to 44100 Hz.

This should be a perfect sine wave at 3000 Hz but instead has the banding seen which is quite audible.

fixed roundnoff bad resampling
mlindner commented 5 years ago

This is caused by the fact that the sample rate converter doesn't use a fourier transform in its sampling. I'm not sure what the intention of the sample rate converter is but it doesn't appear to be for converting sample rates.