Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
universal player script
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Multimedia
View previous topic :: View next topic  
Author Message
nipplehead
n00b
n00b


Joined: 09 Aug 2002
Posts: 35
Location: NYU

PostPosted: Thu Nov 07, 2002 5:53 pm    Post subject: universal player script Reply with quote

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.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Multimedia All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum