I want to use crontab to play recordings of the big Ben every hour and at 15,30 and 45 minutes.
So far I'm using mplayer2 and the following tasks:
0 1,13 * * * mplayer -really-quiet ~/bin/bigben/Clock_Chime_01.ogg -volume 100 >/dev/null 2>&1 # JOB_ID_75
0 2,14 * * * mplayer -really-quiet ~/bin/bigben/Clock_Chime_02.ogg -volume 100 >/dev/null 2>&1 # JOB_ID_76
0 3,15 * * * mplayer -really-quiet ~/bin/bigben/Clock_Chime_03.ogg -volume 100 >/dev/null 2>&1 # JOB_ID_77
0 4,16 * * * mplayer -really-quiet ~/bin/bigben/Clock_Chime_04.ogg -volume 100 >/dev/null 2>&1 # JOB_ID_78
0 5,17 * * * mplayer -really-quiet ~/bin/bigben/Clock_Chime_05.ogg -volume 100 >/dev/null 2>&1 # JOB_ID_79
0 6,18 * * * mplayer -really-quiet ~/bin/bigben/Clock_Chime_06.ogg -volume 100 >/dev/null 2>&1 # JOB_ID_80
0 7,19 * * * mplayer -really-quiet ~/bin/bigben/Clock_Chime_07.ogg -volume 100 >/dev/null 2>&1 # JOB_ID_81
0 8,20 * * * mplayer -really-quiet ~/bin/bigben/Clock_Chime_08.ogg -volume 100 >/dev/null 2>&1 # JOB_ID_82
0 9,21 * * * mplayer -really-quiet ~/bin/bigben/Clock_Chime_09.ogg -volume 100 >/dev/null 2>&1 # JOB_ID_83
0 10,22 * * * mplayer -really-quiet ~/bin/bigben/Clock_Chime_10.ogg -volume 100 >/dev/null 2>&1 # JOB_ID_84
0 11,23 * * * mplayer -really-quiet ~/bin/bigben/Clock_Chime_11.ogg -volume 100 >/dev/null 2>&1 # JOB_ID_85
0 0,12 * * * mplayer -really-quiet ~/bin/bigben/Clock_Chime_12.ogg -volume 100 >/dev/null 2>&1 # JOB_ID_86
15 0-23 * * * mplayer -really-quiet ~/bin/bigben/Clock_Chime_15-1.ogg -volume 100 >/dev/null 2>&1
30 0-23 * * * mplayer -really-quiet ~/bin/bigben/Clock_Chime_15-2.ogg -volume 100 >/dev/null 2>&1
45 0-23 * * * mplayer -really-quiet ~/bin/bigben /Clock_Chime_15-3.ogg -volume 100 >/dev/null 2>&1
But most of the time it does not work. Sometimes it does play the sound but delayed. ie. supposed to play at 21:15, and it didn't at 21:17 I opened a terminal and played another file with mplayer, after it finished, I heard the one supposed to play 2 min earlier.
Edit:
Now trying with:
* * * * * "/usr/bin/mplayer -volume 100 --ao=pulse /home/myuser/bin/bigben/Clock_Chime_15-1.ogg"
without success.
I do have the feeling like the task stays in some kind of cue.
PS. I can share the sound files.
/dev/null
, so that you can see evidence of each invocation. Logstderr
also. – andy256 Jan 11 '16 at 01:37>/dev/null 2>&1
is something I added a long time ago trying to hide the terminal that poped up when playing the sound. Based on your coment I did removed>/dev/null
and it worked , however I really do not know how or why, and if it was just a coincidence. – fbm224 Jan 11 '16 at 02:56* * * * * mplayer -volume 100 --ao=pulse ~/bin/bigben/Clock_Chime_15-2.ogg 2>&1
– fbm224 Jan 11 '16 at 05:46