> Just generate a random number modulo the number of files, and then play that file
That won't be uniform. If you want really random shuffle, mod to the closest next power of 2 then re-sample until you get a number within the bounds.