Skip to content

Instantly share code, notes, and snippets.

@hugs
Forked from xguse/brownNoise.sh
Created April 1, 2011 21:41
Show Gist options
  • Save hugs/898915 to your computer and use it in GitHub Desktop.
Save hugs/898915 to your computer and use it in GitHub Desktop.
Soothing noise generator
#!/bin/sh
# Jason Huggins (@hugs)
#
# Install:
# * Download http://sourceforge.net/projects/sox/files/sox/14.3.2/
# * Unzip and the place "play" binary somewhere in your $PATH
# Explanation of settings:
# - Stereo (2 channels): -c 2
# - 32k rate (high quality): -r 32k
# - Play for 8 hours (can also be set at the command line): 08:00:00
# - Brown noise (Brown's the *best*! Suck it, white!): -n synth brownnoise
# - Slight oscillation in volume: tremelo .1 40
# Example Usage:
# $ noise
# (plays noise for 8 hours)
#
# $ noise 00:01:00
# (plays noise for 1 minute)
# $ noise 10
# (plays noise for 10 seconds)
len='8:00:00'
if [ "$1" != '' ]; then
len=$1
fi
play -c 2 -r 32k -n synth $len brownnoise tremolo .1 40
@rsvp
Copy link

rsvp commented Sep 11, 2011

would you know why the sound gets overblown when "-r 44100"? That such a standard settings... anyways, had to omit that argument in my code https://gist.github.com/1209835 which at least reduces CPU usage by 95% :-)

@hugs
Copy link
Author

hugs commented Dec 27, 2011

@rsvp, sorry, I don't know anything about that issue. In true empirical style, I know what works, and not much else. ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment