View Single Post
Old 5th February 2018, 00:17   #16  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Quote:
Originally Posted by manolito View Post
"ResampleAudio" is only used when "SSRC" is not possible. It works reliably
SSRC used to be somewhat better than ResampleAudio, but little advantage nowadays, also fails on some conversions, I always use ResampleAudio now (used to always use SSRC, except when fails with error).

Quote:
Originally Posted by IanB View Post
Originally when SSRC was added ResampleAudio() only processed 16bit samples. SSRC always processes in ieee 32bit floats. ResampleAudio has since been taught how to also process in floats, so the gap has closed.

SSRC() by default uses Naoki Shibata's "fast" algorithm which yield very excellent result under most normal circumstances. If required you may do SSRC(fast=False) which will use the "slow" algorithm. This is for when you are doing large samplerate down conversions (more than a factor 2). When converting between 32K, 44.1K and 48K there is almost no observable difference. The "slow" algorithm gives improved aliasing prevention at the cost of processing speed.

However SSRC can only convert between particular sample rates as defined by these expressions :-
ResampleAudio() has no such restriction. It uses a a brute force 64 tap FIR filter approach with triangular interpolation. It is about the same speed as "fast" mode SSRC. SSRC uses a fast and clever factoring approach that achieves results similar to a 512 tap FIR filter in "fast" mode and a 4096 tap FIR filter in "slow" mode. For processing 16bit CD grade audio both filters in all modes well exceed the quality requirements of the 16bit data. In float mode a trained observer might be able to detect differences with a true 24bit audio stream.
https://forum.doom9.org/newreply.php...eply&p=1581678

Quote:
Originally Posted by IanB View Post
For 16 bit audio samples ResampleAudio() will be indistinguishable from SSRC(). Also it does not have input/output ratio restriction and you will avoid a ConvertAudioToFloat/ConvertAudioTo16bit pair.

And the question about length relates to the total amount of error we are talking about 14.999 -> 15.0 over 20 minutes is 80 milliseconds ==> don't change it! (It's a lot less than 200ms)

Also 14.999 -> 14.985 over 20 minutes is 1116 milliseconds ==> Do change it!

At 15 fps each frame is 66.6 milliseconds.
https://forum.doom9.org/newreply.php...reply&p=973680

EDIT: More, google
Code:
resampleaudio ssrc ianB site:forum.doom9.org
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 5th February 2018 at 00:31.
StainlessS is offline   Reply With Quote