How to repeat playing mp3 with mpg123
cpghost at cordula.ws
Mon Mar 2 13:25:39 PST 2009
On Mon, Mar 02, 2009 at 10:55:29PM +0800, lacalling wrote:
> Since mpg123 does not support repeat model, i tried to write a script to
> play mp3 repeatedly.
> I tried bash like this
> mpg123 [mp3] &
> but it keeps running new mpg123 in background .
You asked for it to run in the background (with '&').
In fact, you're spawning many mpg123 processes here...
> but mpg123 [mp3] in foreground cant be terminated by control C
Not too familiar with mpg123 (I'm using mplayer), but in such
close loops, Ctrl-C usually works, but not as intended: it stops
one mpg123 process (unless mpg123 sets its signal mask in such a
way as to block or ignore SIGINT?), but the next one resumes
almost immediately thereafter.
To Ctrl-C the loop itself is not easy, because the time slice
between the end of one mpg123 process and the start of the next
one (when the shell is in the foreground) is pretty tiny. Try
adding a 'sleep 1' or something like that after mpg123, and it
will be easier.
> Could anyone provide more ideas.
> thank you.
Cordula's Web. http://www.cordula.ws/
More information about the freebsd-questions