Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!nntp.club.cc.cmu.edu!micro-heart-of-gold.mit.edu!bloom-beacon.mit.edu!bloom-beacon.mit.edu!panix!not-for-mail From: JohnF Newsgroups: comp.os.linux.misc Subject: Re: White Noise Software For Linux Date: Fri, 3 Oct 2014 02:13:21 +0000 (UTC) Organization: PANIX Public Access Internet and UNIX, NYC Lines: 52 Message-ID: References: <0eb566bb-5d54-47fd-b24a-53b85abda9ed@googlegroups.com> NNTP-Posting-Host: panix3.panix.com X-Trace: reader1.panix.com 1412302401 29543 166.84.1.3 (3 Oct 2014 02:13:21 GMT) X-Complaints-To: abuse@panix.com NNTP-Posting-Date: Fri, 3 Oct 2014 02:13:21 +0000 (UTC) User-Agent: tin/2.0.0-20110823 ("Ardenistiel") (UNIX) (NetBSD/6.1.4 (i386)) Xref: csiph.com comp.os.linux.misc:12198 Rich wrote: > JohnF wrote: >> Rich wrote: >> > beforewisdom@gmail.com wrote: >> > >> >> Can anyone recommend any white noise software >> > >> > sox has a large number of "noise" (both white and colored) options. >> > Here is one that someone posted somewhere on Usenet in the not too >> > distant past to generate brown noise: >> > play -q -c 2 -n synth brownnoise band -n 1600 1500 tremolo .1 30 > >> Thanks, that works great. And I see from man sox (or man play) >> that output can be saved to a file. And I suppose it's got to be >> pretty obvious, but I'm not seeing (or getting it to work >> by messing around) exactly how to do that with your above example. >> That is, suppose I want to generate, say, a 1GB file containing >> the above, something functionally like the second line below... >> play -q -c 2 -n synth brownnoise band -n 1600 1500 tremolo .1 30 \ >> --size 1GB --format mp3 -o brownnoise.mp3 >> How would I correctly do that? Thanks again, > > After many false starts (sox has a very convoluted CLI interface), > I found the "hint" in the docs to make it work: > sox -q -c 2 -n out.wav synth brownnoise band -n 1600 1500 tremolo .1 30 > Produces brownnoise in out.wav. Thanks so much, Rich. That works perfectly. I thought I'd looked at that -n in man sox, and it said null device/file. Seems weird that it works, but maybe I shouldn't be asking too many questions:). > What it does not do is "stop" at a certain length. You could watch the > file in another window, and kill the sox command when the file reaches > the length you want. If you really want to directly output a specific > length, then this will work (sox will complain that the wav header > length value will be incorrect, but the file seems to play anyway): > sox -q -c 2 -n -t wav - synth brownnoise band -n 1600 1500 tremolo .1 30 > | dd of=out.wav bs=1024 count=1000 > bs = block size > count = number of blocks > So total size is bs*count, adjust to the size you wish to obtain. Thanks, again. Kind of "my bad" about that size thing, which I just threw in without thinking much. Very sorry if it made you work more. Ctrl-C is pretty much okay for me, or maybe --seconds for duration of play would've been a more sensible -switch. By the way, I let it run for maybe ~10secs (on an i7-3770K), and out.wav contained ~448MB. I was curious to see if sox ended abruptly or terminated the file properly after Ctrl-C, but haven't listened all the way to the end yet:). Thanks, -- John Forkosh ( mailto: j@f.com where j=john and f=forkosh )