Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.os.linux.misc > #12201

Re: White Noise Software For Linux

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 <john@please.see.sig.for.email.com>
Newsgroups comp.os.linux.misc
Subject Re: White Noise Software For Linux
Date Fri, 3 Oct 2014 05:38:09 +0000 (UTC)
Organization PANIX Public Access Internet and UNIX, NYC
Lines 89
Message-ID <m0lco1$d7o$1@reader1.panix.com> (permalink)
References <0eb566bb-5d54-47fd-b24a-53b85abda9ed@googlegroups.com> <lvm7ac$fv6$1@speranza.aioe.org> <lvmh1m$7uv$1@dont-email.me> <m0konm$ipq$1@reader1.panix.com> <m0kurv$v0j$1@dont-email.me> <m0l0o1$sr7$1@reader1.panix.com> <m0l36d$if6$1@dont-email.me>
NNTP-Posting-Host panix3.panix.com
X-Trace reader1.panix.com 1412314689 13560 166.84.1.3 (3 Oct 2014 05:38:09 GMT)
X-Complaints-To abuse@panix.com
NNTP-Posting-Date Fri, 3 Oct 2014 05:38:09 +0000 (UTC)
User-Agent tin/2.0.0-20110823 ("Ardenistiel") (UNIX) (NetBSD/6.1.4 (i386))
Xref csiph.com comp.os.linux.misc:12201

Show key headers only | View raw


Rich <rich@example.invalid> wrote:
> JohnF <john@please.see.sig.for.email.com> wrote:
>> Rich <rich@example.invalid> wrote:
>> > JohnF <john@please.see.sig.for.email.com> wrote:
>> >> Rich <rich@example.invalid> 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:).
> 
> Sox has an odd ordering of parameters:
>  sox [global stuff] [input file] [output file] [effects]

Thanks, Rich. That makes a lot more sense now.
I didn't figure it out from browsing the long sox man page.

>> > 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.
> 
> Nah, how to "get X amount" was the easy part, once I figured out how to
> get it to "write to a file".  I'd already encountered the hyphen for
> stdout (which is quite common) in the manpage.  So once I knew where
> the output file needed to be, clipping the result was easy.
> 
>> 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,
> 
> ^C likely results in a final sample that is clipped.  The "dd" method
> wil clip the final sample also (unless you compute number of samples +
> header byte length and set a specifc dd size first, or get very lucky
> in your size choice).

I used lame to convert to mp3, and that didn't emit any complaints,
so I guess the .wav's okay, or okay enough. After messing around
a bit, what I ended up using was
   sox -q -c 1 -n white.wav synth noise band -n 900 1400
   lame white.wav white.mp3
and I suppose sox's output could be piped to lame's input,
avoiding the intermediate .wav file, but from discussion above
it might be wiser to avoid trying to figure that out:).
By the way, this is for a whitenoise generator, using...
 bhphotovideo.com/c/product/679046-REG/Pyle_Pro_PCAU22_PCAU22_Mini_40_Watt.html
 bhphotovideo.com/c/product/597576-REG/Pyle_Pro_PCB4BK_PCB4_200W_4_Mini.html
(url's just illustrate what I'm using; not (dis)recommending this seller,
and there's a later PCAU25A). The PCAU22 (and 25A) have usb slots,
and just continue repeating whatever's on the stick.
Right now, I have an old whitenoise generator (whose "native" volume
is too low) plugged into amp's input, but the usb stick will be
a lot neater. Thanks again,
-- 
John Forkosh  ( mailto:  j@f.com  where j=john and f=forkosh )

Back to comp.os.linux.misc | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

White Noise Software For Linux beforewisdom@gmail.com - 2014-09-19 16:41 -0700
  Re: White Noise Software For Linux William Unruh <unruh@invalid.ca> - 2014-09-20 06:39 +0000
    Re: White Noise Software For Linux The Natural Philosopher <tnp@invalid.invalid> - 2014-09-20 09:32 +0100
      Re: White Noise Software For Linux floyd@apaflo.com (Floyd L. Davidson) - 2014-09-20 02:44 -0800
        Re: White Noise Software For Linux The Natural Philosopher <tnp@invalid.invalid> - 2014-09-20 11:53 +0100
          Re: White Noise Software For Linux floyd@apaflo.com (Floyd L. Davidson) - 2014-09-20 04:25 -0800
            Re: White Noise Software For Linux Michael Black <et472@ncf.ca> - 2014-09-20 11:52 -0400
        Re: White Noise Software For Linux William Unruh <unruh@invalid.ca> - 2014-09-22 18:31 +0000
          Re: White Noise Software For Linux floyd@apaflo.com (Floyd L. Davidson) - 2014-09-22 18:59 -0800
            Re: White Noise Software For Linux Michael Black <et472@ncf.ca> - 2014-09-22 23:30 -0400
              Re: White Noise Software For Linux floyd@apaflo.com (Floyd L. Davidson) - 2014-09-23 02:51 -0800
                Re: White Noise Software For Linux William Unruh <unruh@invalid.ca> - 2014-09-23 23:49 +0000
  Re: White Noise Software For Linux asdf <asdf@nospam.com> - 2014-09-21 09:55 +0000
    Re: White Noise Software For Linux Rich <rich@example.invalid> - 2014-09-21 12:41 +0000
      Re: White Noise Software For Linux JohnF <john@please.see.sig.for.email.com> - 2014-10-02 23:56 +0000
        Re: White Noise Software For Linux Rich <rich@example.invalid> - 2014-10-03 01:41 +0000
          Re: White Noise Software For Linux JohnF <john@please.see.sig.for.email.com> - 2014-10-03 02:13 +0000
            Re: White Noise Software For Linux Rich <rich@example.invalid> - 2014-10-03 02:55 +0000
              Re: White Noise Software For Linux JohnF <john@please.see.sig.for.email.com> - 2014-10-03 05:38 +0000
                Re: White Noise Software For Linux JohnF <john@please.see.sig.for.email.com> - 2014-10-03 11:50 +0000
                Re: White Noise Software For Linux Loki Harfagr <l0k1@thedarkdesign.free.fr.INVALID> - 2014-10-07 13:04 +0000
        Re: White Noise Software For Linux William Unruh <unruh@invalid.ca> - 2014-10-03 14:38 +0000
          Re: White Noise Software For Linux JohnF <john@please.see.sig.for.email.com> - 2014-10-08 03:18 +0000

csiph-web