[CLUE-Tech] mpg123 - recursively play directories? (solved?)

Sean LeBlanc seanleblanc at americanisp.net
Mon Aug 26 17:27:07 MDT 2002


On 08-26 18:57, Adam Bultman wrote:
> 
> 
> Here's a zinger:
> 
> How can you *randomize* that now?  I use xmms, and it's 'random' play
> plays in the exact same order every single day.  If I don't 'randomize'
> the list, I listen to the same music every day over and over again. And,
> random play isn't that random - it doesn't jump all over, and tends to
> play like, 10 songs away.....

Hi there. I'd like to take credit for this, but this was the result of some
Googling. What you really want is a shuffle, not just randomly selected
songs, right? So I'd put the following in an executable file, call it
"shuffle".

awk "BEGIN { srand($$) } { print int(rand()*1000000), \$0 }" $* |
sort -n |
sed 's/^[0-9]* //'

Then pipe your find through this, then into xargs, using xmms or mpg123.

find /path/to/mp3stuff/ -name *.mp3 | shuffle | xargs xmms 

I wonder why XMMS doesn't use a better source of random numbers? Since it's
open source, I guess I could always check. :)

-- 
Sean LeBlanc:seanleblanc at americanisp.net  
One thing about the past. It's likely to last. 
-Ogden Nash 



More information about the clue-tech mailing list