[LAU] Resampling 48000hz samples down to 44100hz?

Frank Barknecht fbar at footils.org
Sat Jan 30 06:39:00 EST 2010


Hallo,
Gabriel M. Beddingfield hat gesagt: // Gabriel M. Beddingfield wrote:

> 
> 
> On Fri, 29 Jan 2010, Andrew C wrote:
> 
> > Hey all,
> >
> > Anyone know any quick ways to resample a large amount of .wav files with
> > spaces in them from 48000hz to 44100hz while still keeping the same wav
> > names?
> 
> Using sox and the command line, you could do it like this:
> 
> $ cd /path/to/wav/files
> $ for N in * ; do \
>      sox "$N" -r 44100 "/path/to/resampled/files/$N" ; \
>    done
> $

I use "sndfile-resample" from the libsamplerate tools - it has excellent
resampling algorithms. The bash line then would be:

$ for N in *.wav ; do \
     sndfile-resample -to 44100 -c 0 "$N" "/path/to/resampled/files/$N"  ; \
   done

"-c 0" selects the resample method: 

  The optional -c argument allows the converter type to be chosen from
  the following list :

       0 : Best Sinc Interpolator
       1 : Medium Sinc Interpolator (default)
       2 : Fastest Sinc Interpolator
       3 : ZOH Interpolator
       4 : Linear Interpolator

Ciao
-- 
Frank



More information about the Linux-audio-user mailing list