Generate white noise to calm a baby
Solution 1:
Use the Swiss army knife for sound generation, SoX.
You install it from the official repositories, simply by typing:
sudo apt-get install sox
Updated, fancy answer (pleasing ocean waves):
After experimenting a bit with SoX, I came up with this great command which imitates the soft murmur of the sea with its soothing sound of waves that flow over a flat sandy beach on a sunny summer day...
Well, enough poetry, here's the command. Listen yourself.
play -n synth brownnoise synth pinknoise mix synth sine amod 0.3 10
Explanation:
This command first generates and mixes brown noise and pink noise, which I find to be the most comfortable and natural noise. Then it generates a sine wave of 0.3
Hz with an offset of 10
% and uses this to modulate the amplitude of our mixed noises to produce the sound of ocean waves.
Modifications:
-
Timer:
You can add a timer and limit the playback duration by specifying the number of seconds, the number of minutes and seconds (mm:ss
) or the number of hours, minutes and seconds (hh:mm:ss
) right beforebrownnoise
. Here's an example for one hour:play -n synth 1:0:0 brownnoise synth pinknoise mix synth sine amod 0.3 10
-
Wave frequency:
If you want the waves to hit the beach more or less frequent, simply change the frequency of the sine wave used for amplitude modification (0.3
in the above command). The number represents the amount of waves per second, so a frequency of0.1
Hz will cause 0.1 waves per second and therefore make one wave last for 10 seconds:play -n synth brownnoise synth pinknoise mix synth sine amod 0.1 10
-
Minimum background noise volume:
The sine that is used for amplitude modulation got shifted to an offset of10
%, so the brown-pink noise will always be played with at least 10% volume. If you want a stronger or weaker background noise, increase or decrease this offset to your needs. Here's an example with20
% background noise:play -n synth brownnoise synth pinknoise mix synth sine amod 0.3 20
Old, boring answer (plain white noise):
Now the easiest command to play white noise infinitely (until you abort it with Ctrl+C) is this:
play -n synth whitenoise
If you prefer a time limit, you may add that in the format hh:mm:ss
. The following command would make noise for one and a half hour, for example:
play -n synth 01:30:00 whitenoise
It even shows you some nice stats while "playing":
$ play -n synth 00:00:05 whitenoise
Encoding: n/a
Channels: 1 @ 32-bit
Samplerate: 48000Hz
Replaygain: off
Duration: unknown
In:0.00% 00:00:05.12 [00:00:00.00] Out:240k [!=====|=====!] Hd:0.0 Clip:0
Done.
Solution 2:
White noise is torture.
Especially for the delicate ears of babies.
This is because white noise has too much energy in the high frequencies.
Solution 3:
You can generate pink noise using the play command from the sox utilities:
sudo apt-get install sox
play -t sl -r48000 -c2 -n synth -1 pinknoise .1 60
Adjust the values of .1 and 60 to suit your needs. Pink noise is less harsh on the ear and is hopefully the sound you require
Solution 4:
Not sure that this will produce real white noise that covers the whole spectrum, but a simple
pacat /dev/urandom
seems to do the trick on my system (no need to install anything new or add a repository).
Solution 5:
I'm a glutton for punishment, so I'll give you the GUI way. Take a look at ANoise.
The default sound that it comes with is bad, but you can download other sounds like Forest Rain, Fountain, & Others. You can set it to start with the system, and even set it to stop after a certain time.
sudo add-apt-repository ppa:costales/anoise
sudo apt-get update
sudo apt-get install anoise
ANoise Code, And for For extra river sound:
sudo apt-get install anoise-community-extension1