Skip to main content

Thread: Using mplayer To Speak Time Every Hour But Prevent Sending of Mail


how prevent mplayer sending e-mail time mplayer plays wave file speaks time?

here script use speak time. use natural voice record this:

code:
"the time ... 1 ... 2 ... 3 ... 4 ... 5 ... 6 ... 7 ... 8 ... 9 ... 10 ... 11 ... 12 ... m  ... p m
once done, separate every parts of waveform (separated "...") , have thetimeis.wav, 01.wav, 02.wav, 03.wav, etc.

last, not least, wrote script:

code:
#!/bin/bash  # time  path=/fileserver/soundfiles/speakclock  sox=/usr/bin/sox  date=/bin/date  $sox $path/thetimeis.wav $path/$($date '+%i').wav $path/$($date '+%p').wav $path/tmp.wav  /usr/bin/mplayer -ao alsa $path/tmp.wav > /dev/null  /bin/rm $path/tmp.wav  #/bin/cat /dev/null > /var/mail/grayson  exit 0
note i've commented out /bin/cat bandage solution delete mail after mplayer plays file. said "bandage solution" because if have grayson@ubuntu-server forward mail e-mail account through smtp relay, i'm going seeing e-mail messages sent every hour , need stop happening in first place.

example of mail i've been getting in /var/mail/grayson:

code:
from grayson@ubuntu-server  sat jul  2 14:00:05 2011  return-path: <grayson@ubuntu-server>  x-original-to: grayson  delivered-to: grayson@ubuntu-server  received: ubuntu-server (postfix, userid 1000)          id 88ffc5f7b4; sat,  2 jul 2011 14:00:05 -0400 (edt)  from: root@ubuntu-server (cron daemon)  to: grayson@ubuntu-server  subject: cron <grayson@ubuntu-server> /fileserver/shell_scripts/saytime_hour  content-type: text/plain; charset=ansi_x3.4-1968  x-cron-env: <shell=/bin/sh>  x-cron-env: <home=/home/grayson>  x-cron-env: <path=/usr/bin:/bin>  x-cron-env: <logname=grayson>  message-id: <20110702180005.88ffc5f7b4@ubuntu-server>  date: sat,  2 jul 2011 14:00:01 -0400 (edt)    mplayer svn-r1.0~rc3+svn20090426-4.4.3 (c) 2000-2009 mplayer team  terminal type `unknown' not defined.    playing /fileserver/soundfiles/speakclock/tmp.wav.  audio file format detected.  ==========================================================================  opening audio decoder: [pcm] uncompressed pcm audio decoder  audio: 44100 hz, 1 ch, s16le, 705.6 kbit/100.00% (ratio: 88200->88200)  selected audio codec: [pcm] afm: pcm (uncompressed pcm)  ==========================================================================  ao: [alsa] 44100hz 1ch s16le (2 bytes per sample)  video: no video  starting playback...  a:   0.0 (00.0) of 1.0 (01.0) ??,?%  a:   0.0 (00.0) of 1.0 (01.0)  0.0%  a:   0.4 (00.3) of 1.0 (01.0)  0.0%  a:   0.4 (00.3) of 1.0 (01.0)  0.0%  a:   0.4 (00.4) of 1.0 (01.0)  0.0%  a:   0.4 (00.4) of 1.0 (01.0)  0.0%  a:   0.5 (00.4) of 1.0 (01.0)  0.0%  a:   0.5 (00.5) of 1.0 (01.0)  0.0%  a:   0.5 (00.5) of 1.0 (01.0)  0.0%  a:   0.6 (00.5) of 1.0 (01.0)  0.0%  a:   0.6 (00.5) of 1.0 (01.0)  0.0%  a:   0.6 (00.6) of 1.0 (01.0)  0.0%  a:   0.7 (00.6) of 1.0 (01.0)  0.0%  a:   0.7 (00.6) of 1.0 (01.0)  0.0%  a:   0.7 (00.6) of 1.0 (01.0)  0.0%  a:   0.7 (00.7) of 1.0 (01.0)  0.0%  a:   0.8 (00.7) of 1.0 (01.0)  0.0%  a:   0.8 (00.7) of 1.0 (01.0)  0.0%  a:   0.8 (00.8) of 1.0 (01.0)  0.0%  a:   0.9 (00.8) of 1.0 (01.0)  0.0%  a:   0.9 (00.8) of 1.0 (01.0)  0.0%  a:   0.9 (00.9) of 1.0 (01.0)  0.0%  a:   0.9 (00.9) of 1.0 (01.0)  0.0%  a:   1.0 (00.9) of 1.0 (01.0)  0.0%  a:   1.0 (01.0) of 1.0 (01.0)  0.0%  a:   1.0 (01.0) of 1.0 (01.0)  0.0%  a:   1.1 (01.0) of 1.0 (01.0)  0.0%  a:   1.1 (01.1) of 1.0 (01.0)  0.0%  a:   1.1 (01.1) of 1.0 (01.0)  0.0%  a:   1.2 (01.1) of 1.0 (01.0)  0.0%  a:   1.2 (01.1) of 1.0 (01.0)  0.0%  a:   1.2 (01.2) of 1.0 (01.0)  0.0%  a:   1.3 (01.2) of 1.0 (01.0)  0.0%  a:   1.3 (01.2) of 1.0 (01.0)  0.0%  a:   1.3 (01.3) of 1.0 (01.0)  0.0%  a:   1.4 (01.3) of 1.0 (01.0)  0.0%  a:   1.4 (01.3) of 1.0 (01.0)  0.0%  a:   1.4 (01.4) of 1.0 (01.0)  0.0%  a:   1.4 (01.4) of 1.0 (01.0)  0.0%  a:   1.5 (01.4) of 1.0 (01.0)  0.0%  a:   1.5 (01.4) of 1.0 (01.0)  0.0%  a:   1.5 (01.5) of 1.0 (01.0)  0.0%      exiting... (end of file)

solution:

"crontab -e" , add " > /dev/null" @ end of command, this:

code:
0 * * * * /fileserver/shell_scripts/saytime_hour > /dev/null
so happened?

cron sends e-mail every hour specified, don't want happen because don't need output produced sox/mplayer, think it's not mplayer, perhaps sox, too.

what's going on. pardon me starting such thread.


Forum The Ubuntu Forum Community Ubuntu Official Flavours Support General Help [SOLVED] Using mplayer To Speak Time Every Hour But Prevent Sending of Mail


Ubuntu

Comments

Popular posts from this blog

How to change text Component easybook reloaded *newbee* - Joomla! Forum - community, help and support

After Effect warning: A problem occurred when processing OpenGL commands

Preconditions Failed. - Joomla! Forum - community, help and support