I have a three week old baby. Occasionally she refuses to sleep. Some people tell me this is the way life is, some people tell me I need to buy things to fix it. This is becoming an alarmingly common pattern in this parenting game.
Anyway one of these things "I need to buy" is a white noise generator. White noise defined as:
a random signal is considered "white noise" if it is observed to have a flat spectrum over the range of frequencies that is relevant to the context. For an audio signal, for example, the relevant range is the band of audible sound frequencies, between 20 to 20,000 Hz.
There are several things I can buy. Apps for Android, dedicated boxes that I'm sure just play a tiny clip of pre-generated noise, all the way to mega-expensive true-random white noise generators.
I want to generate my own white noise sample
I know I could download one with youtube-dl
from one of the many videos out there but copyright aside, frequency compression is horrible online I want full-white-frequency goodness. If such a thing actually exists. Plus I'm a glutton for punishment and I believe that if something can be done via the command line, that's the way we should be doing it. That's how I aim to raise this one anyway.
So we have things like /dev/urandom
and paplay
. Is there a sensible way to take random data and channel it into the audible range of white noise and out of my speakers? Answers that write to file are okay too. The important thing is a steady range-confined sample. No squawks.
Note: answers that generate the brown note will not be appreciated ☹