Rather than buying one of the various baby soother CDs out there, I thought I would try making a plain white noise CD instead.
With a useful hint from this page, I used the SoX program to generate the sound data. The command line is:
sox -t sl -r 44100 -c 2 /dev/zero -r 44100 -c 2 -w whitenoise.wav synth 10:00 whitenoise vol 0.6 fade q 10 10:00 10
Breaking this down:
sox
options describe the input to SoX. Because SoX is normally
used to process an existing sound signal, it always expects an input—even in cases like this
one, where the output sound is being generated from scratch. So we feed in an blank input signal to
keep it happy.-t sl
: expect input in signed long raw format-r 441000 -c 2
: pretend that the input is 44.1 kHz stereo (included to suppress a warning)/dev/zero
: get input from the
/dev/zero
file, which is just a stream of zeroessox
.-r 44100
: generate output with a sample rate of 44.1kHz (which is CD quality)-c 2
: two channels (i.e. stereo) output-w
: generate 16-bit outputwhitenoise.wav
: the name of the file that the output is stored in
(the .wav
extension means SoX will generate a file in WAV format)synth 10:00 whitenoise
: generate white noise output that is 10 minutes in lengthvol 0.6
: scale the volume to 60%fade q 10 10:00 10
: fade in for 10 seconds and fade out 10 seconds before the
10:00 mark, in each case changing the volume in a shape like quarter of a sine wave (q
)I then repeated the whole process with the pinknoise
option instead of whitenoise
.
To produce MP3 files, I installed LAME (and then rebuilt/reinstalled SoX so that it picked up the presence of LAME). Then it was just a case of doing:
sox whitenoise.wav whitenoise.mp3
(which sticks with a default 128kbps bitrate)