Glad I could help Xswitch. I learned some too. I didn't realize all the stuff sox could do, the effects and mixing are pretty cool.
http://sox.sourceforge.net/
http://dsl.org/cookbook/cookbook_29.html#SEC404
Here's a little script I put together. It'll play a random sound file at a random time. To use it, do this:
1) Put it in a file called something like rndplay in your /home/<username>/bin directory.
2) At a shell window (command prompt), cd to a directory containing a bunch of sound files (wav or mp3).
3) Run the command:
> rndplay *.wav
Adjust the mintime and maxtime to your liking.
Substitute the play command near the bottom for mplayer or whatever command is working for you.
I like to run it on the Looney Tunes sound clips I collected, listen to Bugs, Daffy, PorkyPig, etc. spout off.
Disclaimer: no guarantees that it will work and use at your own risk.
> Shell script - copy after this line <
# play random sound files at random time
# works with a list of files up to 32767 files
# configuration
# min and max time delay in seconds
mintime=60
maxtime=3600
# calc the random values
max=$(($maxtime - $mintime + 1))
# count the files
filecount=`ls $* | wc -l`
echo "-----------------------------------------"
echo "Total number of sound files = $filecount"
echo "Minimum Delay = $mintime seconds"
echo "Maximum Delay = $maxtime seconds"
# infinite loop
while :
do
# pick a random time
rdmtime=$((RANDOM%$max+$mintime))
# pick a random file number
rdmfilenum=$((RANDOM%$filecount+1))
count=0
for file in `ls $*`
do
count=$(($count + 1))
if [ $count -eq $rdmfilenum ]
then
pickfile=$file
break
fi
done
# Calc hours, minutes, and seconds
hrs=$(($rdmtime/3600))
mins=$((($rdmtime % 3600) / 60))
secs=$((($rdmtime % 3600) % 60))
echo "-----------------------------------------"
echo "Random number of sound file = $rdmfilenum"
echo "Sound File to play = $pickfile"
echo "Time Delay = $rdmtime secs ($hrs:$mins:$secs)"
# Wait the time delay
sleep $rdmtime
# Play the sound file
play $pickfile
done