DSPRelated.com
Code

WAV Subsample

Ron April 1, 2011 Coded in Matlab

 

A script that subsamples a WAV file to compress it. 

factor represents the bit rate reduction as a fraction (original/factor)

 

factor = 8;
[X, fs, nbits] = wavread('in.wav');
Y = downsample(X,factor);
wavwrite (Y, fs/factor, nbits, 'out.wav');