espeak
Simple tool to speak sentences out loud.
I tried to use this to make the Harman Kardon Soundsticks not switch the f&$% off every few minutes However it does not work quite well, for unknown reasons you just don't hear anything and other times there is an echo like it fires multiple times at once.
Don't use espeak for this : use kalarm (see software/tools/kalarm)
Still I will leave the rest of this chapter intact ..
Espeak itself is deadly simple :
| speak | |
|---|---|
But it may take some time to get the voice the way you like. For instance when speaking dates this setting seems to sound better :
| altering voice | |
|---|---|
crontab
I created a crontab job that pronounces the date, which did not work :
| not working | |
|---|---|
It seems the pipe symbol does not play quite well with crontab, so i altered to a script in my home directory :
The new crontab now becomes this :
| crontab | |
|---|---|
Note i changed the interval to test how long it takes for the speakers to shutdown. .. what works best ? Note that in crontab :
In crontab 5 would mean every 5 minutes past the hour, this notation means every 5 minutes.
wave file
You can do the same with a file that produces a tone that is (almost) too low to hear. In the home/bin repository there are two files to do something like that:
- ping.sh is for playing a small ping to attend me to relax my shoulders
- wake.sh is for playing a wake_up signal to the sound stick at 20 Hz
Only one of these will suffice :
| low note | |
|---|---|
The 20hz file should be long enough for the sticks to wake up, 3 seconds at least. I use play because :
- mplayer seems to hang regularly
- play does not need a gui to play
- aplay does not have a volume option
The XDG_RUNTIME_DIR is one of many settings i needed and which seems to change every new linux install. To find out just put env inside the ping.sh script and compare the output running it by hand and in the mail resulting from crontab.
Device or resource busy
This problem occurs when you try the wave file crontab solution above, but also have player running. In the logs /var/log/syslog you will get these messages.. and no sound is heard. Running the script from the command line has no problem running together with mplayer.
It seems to be an environment problem, which setting I have no idea but this line in the script solves the problem.
| crontab profile | |
|---|---|
Just load the same profile and all works well.