LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to play sound file using xmms and then having xmms quit... (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-play-sound-file-using-xmms-and-then-having-xmms-quit-691109/)

trist007 12-16-2008 11:17 PM

How to play sound file using xmms and then having xmms quit...
 
I know that the line

xmms /usr/share/sounds/sound.ogg works, it opens xmms and plays the sound. What command line would have it play the sound and then close xmms right after?

I tried

xmms /usr/share/sounds/sound.ogg ; sudo killall xmms

but that doesn't shut xmms down right after the sound.

jschiwal 12-16-2008 11:52 PM

You could use ogg123 instead.

You could run xmms in the background, and in the foreground, sleep long enough for the program to run. Then kill it.
The problems is that if a program doesn't return, the next program won't run. So the second part of your oneliner won't be reached. You could maybe use ogginfo to get the playlength of the oggfile and use that to determine how long to sleep.

trist007 12-17-2008 12:00 AM

sleep rox, thanks


All times are GMT -5. The time now is 11:07 AM.