Downsampling audio recordings

Working with large audio files can be quite unwieldy. Unfortunately, popular handheld digital recorders like the Zoom H4n or Roland R-09HR do not have the option of recording uncompressed WAV files at less than 44.1kHz, presumably since the companies are marketing to musicians/music fans. For speech analysis, 16kHz is generally sufficient since energy in the speech signal generally falls below 8kHz.

It is possible to downsample files in Praat using the command Convert > Resample... when a Sound object (not a LongSound object) is selected. However, I have sometimes had trouble with running out of memory using this method.

Another method is to use command line tools, namely, sox, a very handy cross-platform command-line utility for sound processing. Here is an example of how to downsample an audio file called sound.wav to 16kHz (that’s the rate 16k) and also to reduce to a 16 bit recording (that’s the -b 16), to an output file named sound-down.wav:

sox sound.wav -b 16 sound-down.wav rate 16k

Some more on sox’s resampling algorithm here.


2 Comments on “Downsampling audio recordings”

  1. Keelan says:

    An equivalent way to specify the sampling rate of the output file with sox is by using the -r argument. So, the following command does the same thing:

    $ sox sound.wav -b 16 -r 16k sound-down.wav

    I usually use this syntax, because I find it easier to remember, although it has the drawback that it doesn’t allow the user to specify any options for the rate effect.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s