I’ve written a class to play random files, you can define the player path and allowed file extentions. It will search recursively for all readable files, starting from execution from the folder passed as argument or, if miss, from current folder. Tested on a linux box with mplayer.
Usage:
$ ./shuffle
# play recursively all files from current folder
$ ./shuffle /path/to/files
# play recursively all files from specified folder
That’s the source code.
#!/usr/bin/ruby