Date: Mon, 2 Mar 2009 22:25:39 +0100 From: cpghost <cpghost@cordula.ws> To: lacalling <lacalling@gmail.com> Cc: freebsd-questions@freebsd.org Subject: Re: How to repeat playing mp3 with mpg123 Message-ID: <20090302212539.GA46243@phenom.cordula.ws> In-Reply-To: <de8d0ce00903020655x4993f340p3dc7bebe8a8614fb@mail.gmail.com> References: <de8d0ce00903020655x4993f340p3dc7bebe8a8614fb@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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 > for((;;)) > do > mpg123 [mp3] & > done > 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. -cpghost. -- Cordula's Web. http://www.cordula.ws/
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090302212539.GA46243>
