Skip to content

Instantly share code, notes, and snippets.

@scribu
Created July 17, 2013 23:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scribu/6025387 to your computer and use it in GitHub Desktop.
Save scribu/6025387 to your computer and use it in GitHub Desktop.
#!/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
@scruss
Copy link

scruss commented Nov 30, 2013

It's not as if I'm planning to take rndsound.sh down soon …

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