[PD] Downsampling to 8KHz

Iain Mott mott at reverberant.com
Tue Apr 12 06:57:38 CEST 2005

hello list!

I'd like to be able to downsample to 8000Hz in a sub-patch in order to
save a file at that rate and encode it in the "speex" format (speex is
optimised to deal with 8k files). Because block~ and switch~ specify the
downsampling factor in reciprocal form (eg. 0.5 is a factor of 2, 0.25 a
factor of 4 etc), I find i'm stuck specifying a factor of 6 (running Pd
at 48k a 6-fold downsample will give me 8k). Because the reciprocal of 6
is a recurring number and there's no quantising of values in the source
to find the nearest multiple of 2, errors result when trying to specify
a 6-fold downsample (eg. a number like 0.16666).

Can anyone see a solution to this - besides altering the source or using
a utility such as sox to do the conversion to 8k (which i'm doing
presently). Would it be useful to anyone else if block~ and switch~
could quantise to multiples of 2? ie. could this be included in
subsequent pd releases?

cheers, iain

Iain Mott

More information about the Pd-list mailing list