Live Chat!

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.

12 Responses to “stupid way to make mplayer repeatly play”

  1. “mplayer -loop 0 foo” would repeat foo indefinitely. A single ‘q’ or ctrl-c would stop it.

  2. Ramprasad: Thanks. Somehow -loop doesn’t work for my particular song.flv, but it works for .mp3, .wav and video .flv from youtube.

  3. blackbelt_jones Says:

    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.

  4. blackbelt_jones Says:

    PS Great idea for a blog, btw

  5. blackbelt_jones: Yup. Obviously, Ramprasad had mention that :)

  6. I like the following loop structure:

    while $(sleep 2); do date; done

    Substitute whatever for the ‘date’ command.

  7. dan: That is neat! thanks.

  8. I like audacious to play a song.

  9. tony1grendel Says:

    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.

  10. tony1grendel: Yeah! But I precious my keyboard :P

  11. good idea dute ! -loop 0 thanks !

  12. mplayer -loop 0 endless

    mplayer -loop n times

    ;)

Leave a Reply