sample rate

It seems there should be an easy way to do this but I can’t find it. I’d like to go to 48k because that is what may wav files are at from other apps. btw, to the reader do you use jack as a time master, or keep ardour set to internal? thanks I excited to get into the program.

It uses the sample rate that JACK is using.

I have a little shell script using the program ‘sndfile-resample’ which resample wav files. The ‘sndfile-resample’ program belongs to a suite of programs included in a package called ‘samplerate-programs’ (at least in debian based distros). So if you have such a debian based system, make sure you ‘apt-get install samplerate-programs’ beforehand. Then, open a terminal, open a file called e.g. with your favorite text editor (I personaly use emacs) and add the following :


if [ ! -z “$1” ]; then

echo " Will resample to new rate ‘$newrate’"

for fname in ls -1; do
wav_file=file $fname | grep "WAVE audio"
if [ -z “$wav_file” ]; then
echo “’$fname’ is NOT a wav file, skipping …”
mv $fname $fname.old && sndfile-resample -to $newrate -c 0 $fname.old $fname && rm $fname.old

I have a default newrate of 96000. You can change this if you want or invoke the script with your preferred rate (see below). Anyway, make that script executable :

chmod +x

move it to your $PATH :

mkdir ~/bin mv ~/bin


sudo mv /usr/local/bin

go to a directory where you have wav files to resample and call the script from the terminal

cd directory-where-i-have-wav-files-to-be-resampled (or ' 48000' if 48000 is not the default in the script)

There are of course cases when this will fail if the filenames have spaces. As an old time unix user, I don’t put spaces in my filenames. So beware :slight_smile:
Moreover, the command line argument (new sample rate) is not checked thoroughly in the script. If you type a garbage string, I don’t know what’s gonna happen :wink:

Hope this helps.