Created
July 17, 2013 23:13
-
-
Save scribu/6025387 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# rndsound.sh - make a wav from the RNG source | |
# must be run as root: sudo ./rndsound.sh | |
# needs sox toolkit: sudo apt-get install sox libsox-fmt-all | |
# created by scruss on Mon Jun 3 23:07:54 EDT 2013 | |
# length of sample, seconds | |
DURATION=5 | |
# output file | |
OUTFILE=random$(date +%Y%m%d%H%M%S).wav | |
dd if=/dev/hwrng status=noxfer | sox -t u16 -c 1 -r 48000 - -c 1 $OUTFILE trim 0 $DURATION | |
# make the file world writeable so it's easier to delete | |
chmod a+w $OUTFILE | |
echo Wrote $OUTFILE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It's not as if I'm planning to take rndsound.sh down soon …