I wanted to record sound files quickly on Windows 7, to create some wav files for an IVR application. Unfortunately, there's nothing included in Windows 7 that handles it. Sure, you can install Windows Media Encoder and the like, but that's cumbersome. And you can record WMA sound files with the windows sound recorder, but then you'll have to use something like FFmpeg to convert it to a wav file. Too much work.
Sox to the rescue! Using a simple batch script, I put together a string of sox commands to do what I need:
@ECHO OFF SET PATH=C:\Users\Public\Documents\sox-14.4.0;%PATH% CLS ECHO %2 sox -t waveaudio default -r 8000 -c 1 -e u-law "%1.wav" silence 1 0.50 -96d 1 00:03 -96d norm vad reverse vad reverse
I saved that in a file named soxrecord.cmd
I created another batch file like so:
soxrecord hello "Hello, and thank you for calling." soxrecord unavailable "Unfortunately, the system is currently unavailable." soxrecord bye "Good bye!"
I saved that in script.cmd.
I set my headset mic to be the default mic.
Now, when I run script.cmd, I see the text on the screen, and I see sox capturing the mic input. I speak the phrase and then I hit the mute button on the headset mic (optional). After 3 seconds, sox stops the recording, trims the beginning and end, and moves on to the next prompt.
That's it! Nice and easy. No need for anything else but sox and a couple of batch files.