a thoughtful web.
Good ideas and conversation. No ads, no tracking.   Login or Take a Tour!
comment
user-inactivated  ·  2853 days ago  ·  link  ·    ·  parent  ·  post: Let's all take a moment to appreciate the Future Sound of London.

Who are the Pixies? shrugs

Shuffle play the FSOL library and you'll have music for literally one week, even when you sleep (7.3325 days by my calculation), and it's almost exactly the same quality music between tracks.

    $ min=0; sec=0; (find . -type f -name \*.mp3 | while read mp3; do ffmpeg -i "$mp3"; done) 2>&1 | grep Duration | sed -r "s/^.*Duration: 00:([^\.]+).*$/\1/g" | while read duration; do let min+=$(echo "$duration" | cut -d ':' -f1); let sec+=$(echo "$duration" | cut -d ':' -f2); done; perl -e "print (($min+($sec/60))/60);"

(we really need a blockquote mechanism to Hubski's markup)

EDIT: ANNNNND this is why you always check your math. I went to go redo the command to be more efficient, multithreaded, use less languages and less Bash mess. Turns out I also didn't divide by 24, meaning this is 7.3325 hours not days. My bad. Just put it on shuffle and loop and you won't notice the difference for those 7.3325 days you are waiting for ;)

    $ find . -type f -name \*.mp3 -print0 | xargs -0 -I{} bash -c 'ffmpeg -i "{}" 2>&1' | awk 'BEGIN{ min=0; sec=0; } /Duration/{ min+=substr($2,4,2); sec+=substr($2,7,2); } END {print (min+(sec/60))/60; }'

EDIT2: And also why you check your source data. I apparently don't have any of the Environments albums, because I had no idea they were still making music!