Re: [Loopdub-devel] Sample Rate Configuration
Brought to you by:
radarsat1
From: Nick T. <nh...@gm...> - 2008-01-03 04:30:42
|
On Jan 2, 2008 10:49 PM, Stephen Sinclair <rad...@gm...> wrote: > (If I didn't add the variables to the configuration file, the values > were initialized to zero, which didn't work too well. :) > :-) > Ideally the InternalSampleRate wouldn't be specified by the user, but > loopdub would just use the sample rate information in the wav file > header. > This would mean a different call to the resampling algorithm for each > loop, however, increasing CPU usage. Not sure it's a good trade-off > if all my loops are encoded at the same samplerate. Perhaps something > more 'intelligent' (i.e., nasty and complicated) could be used to do > the resampling before or after mixing depending on whether all the > loop samplerates are the same. > Here's a proposal for you: 1. Merge the internal and hardware sample rates. 2. Automatically resample all loops to the hardware sample rate when they are loaded. The resampling happens once per loop, at load time, meaning probably-insignificant CPU usage for resampling; the delay caused by the resampling would probably be dwarfed by the time spent reading the file itself. This also means that no resampling is necessary during mixing, since everything is already at the correct sample rate. Now, what about the clicking problem? Let's run with the integer-multiple buffer size solution, and see where it takes us. WAV files could theoretically be at any sample rate, but in practice will almost always be one of the sample rates listed here: http://en.wikipedia.org/wiki/Sample_rate#Audio So, perhaps we could devise a buffer size that is compatible with most of those sample rates, and simply print a warning for the user when they load a sample that is not at one of those sample rates. Not a fully general solution, but perhaps a practical one? |