nipplehead n00b
Joined: 09 Aug 2002 Posts: 35 Location: NYU
|
Posted: Thu Nov 07, 2002 5:53 pm Post subject: universal player script |
|
|
as a console junkie who stays out of X as much as possible, i got tired of having to use different commands for each sound file type i had (ogg123, mpg123, aplay) i wrote up a little script to put in ~/bin/uplay to let you have a universal command line player. i'll be adding a way to do playlists etc soon as i refresh myself on bash scripting.
Code: |
#!/bin/bash
for song in "$@"
do
if [ "${song##*.}" = "wav" ]
then
aplay "$song"
elif [ "${song##*.}" = "mp3" ]
then
mpg123 "$song"
elif [ "${song##*.}" = "ogg" ]
then
ogg123 "$song"
fi
done
|
currently it takes as many sound files as arguments as you want, e.g.:
Code: | 99% peter@gonzo peter $ uplay wav/ozma-natalie_portman.wav mp3/saves\ the\ day\
-\ nightingale.mp3 ogg/stanton_moore/stanton\ moore\ -\ tang\ the\ hump.mp3 |
hope you all enjoy. as usual, any feedback or suggestions are welcome. _________________ System: Thinkpad T30, P4-m 1.8GHz, 1024MB RAM
To Do: winmodem. grr. lexmark 3200 = winprinter. grr. |
|