stupid way to make mplayer repeatly play
0 votos
November 3rd, 2007 mysurface Posted in Bash, for, mplayer, sleep | Hits: 19588 |
I am so desperately wanna make mplayer repeat a song, somehow I obtain a song in flv format. I fail to figure out how to make mplayer repeat, so here make a stupid workaround with bash for.
for (( ; ; )); do mplayer nicesong.flv; sleep 0.1; done
Kill it by hitting ctrl+c two times very fast!
heh! Why I need sleep after mplayer? If you don’t put sleep, you won’t be able to kill it by hitting ctrl+c no matter how many times.
Live Chat!









November 3rd, 2007 at 2:35 am
“mplayer -loop 0 foo” would repeat foo indefinitely. A single ‘q’ or ctrl-c would stop it.
November 3rd, 2007 at 3:57 am
Ramprasad: Thanks. Somehow -loop doesn’t work for my particular song.flv, but it works for .mp3, .wav and video .flv from youtube.
November 3rd, 2007 at 8:01 pm
I don’t know anything about .flv, but -loop alone doesn’t complete the option. It’s -loop 2 for 2 repeats, -loop 3 for 3 repeats, etc, including -loop 0 for endless repeats.
November 3rd, 2007 at 8:02 pm
PS Great idea for a blog, btw
November 3rd, 2007 at 10:44 pm
blackbelt_jones: Yup. Obviously, Ramprasad had mention that :)
November 3rd, 2007 at 11:31 pm
I like the following loop structure:
while $(sleep 2); do date; done
Substitute whatever for the ‘date’ command.
November 3rd, 2007 at 11:45 pm
dan: That is neat! thanks.
November 13th, 2007 at 8:13 pm
I like audacious to play a song.
February 10th, 2008 at 5:44 pm
You don’t need sleep.
You can stop it by hitting ctrl+c, many many times. button mash it like crazy. I tried it with date, instead of mplayer …, and was able to get it terminated in a faster time. You just need to hit that c over and over fast.
February 10th, 2008 at 11:46 pm
tony1grendel: Yeah! But I precious my keyboard :P
April 10th, 2008 at 7:22 am
good idea dute ! -loop 0 thanks !
June 18th, 2008 at 12:08 am
mplayer -loop 0 endless
mplayer -loop n times
;)