#!/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