Topic: talking alarms?

I looked so I guess it doesn't exist. It would be so great to have scheduled alarms with programmable messages that are "read" aloud. Would be amazingly helpful for me but it doesn't seem to exist. Any ideas?

Re: talking alarms?

Well, it can be done with some hacking.

A while back, on a lark, I ported one of the common text->speech systems (I think it was Festival Lite) - it was a pretty easy port, but unfortunately I didn't save the instructions.  Combine that with the "custom alarm actions" that are documented on the wiki, then you could do it.

Re: talking alarms?

do you have a link to festival light?

Re: talking alarms?

http://www.speech.cs.cmu.edu/flite/

Re: talking alarms?

another thought,  depending on what you want the talking alarms to say, would be to just record what you want with the chumby mic, then using the custom alarms, just play back the resultant wave files, this, assumes, of course, you only had a set number of things, not dynamically changing.

Cleaning up any loose bits and bytes.

Re: talking alarms?

Two talking clocks exists at this moment: Talking Clock and Rectangular Talking Clock. I know these do not do what you are wanting. However, maybe you can talk one of them to make some enhancements. In the first case, they have already built flite (text to speech) that works great on the Chumby. I would guess that you may even be able to use existing items to "read" text to you at specific times.

Re: talking alarms?

Here's something else to try - use the Google text-to-speech engine:

1) Create a My Streams MP3 entry with the URL:

http://translate.google.com/translate_tts?tl=en&q=wake%20up%20lazy%20bones

2) Set an alarm to play that stream

I haven't tried it, but if it works, you should be able to change the text to say whatever you want, making sure you properly escape punctuation (ie use "%20" for spaces).

Re: talking alarms?

Duane, did your port of Flite work on an Infocast? The Talking Clock app doesn't speak on my Infocast.

Re: talking alarms?

I never tried it on the Infocast - this was done a couple of years ago on Ironforge.

10 (edited by RichR 2011-03-03 13:40:40)

Re: talking alarms?

Alas. I'm getting the error
               
                audio_open_alsa: failed to set sample rate near 16000. Invalid argument.

When I run the flite executables. flite_time displays the text it would have said, then throws the error.

Have you seen this alsa error before?

Re: talking alarms?

By the way Duane, I tried translate.google.com in My Streams and it works great. When I tell the custom alarm to play the stream, it just does a "beep-beep-beep" style alarm. Maybe I did something wrong, but do not see what I could have done.

Re: talking alarms?

Any help with this Duane?

Re: talking alarms?

I'll take a look.

Re: talking alarms?

RichR wrote:

Alas. I'm getting the error
               
                audio_open_alsa: failed to set sample rate near 16000. Invalid argument.

When I run the flite executables. flite_time displays the text it would have said, then throws the error.

Have you seen this alsa error before?

What binaries were you trying to run?  I cross-compiled flite and it seems to work fine on one of my c1s, but not my other one.

alsa-lib:
./configure --host=arm-linux --disable-python --prefix=$(pwd)/install; make; make isntall
flite:
export CFLAGS=-I$(pwd)/../alsa-lib-1.0.24.1/install/include
export LDFLAGS=-L$(pwd)/../alsa-lib-1.0.24.1/install/lib/
export LIBS=-lasound
./configure --host=arm-linux --prefix=$(pwd)/install --with-audio=alsa
make && make install

That ran fine on my c1 at home (that i use for mostly dev stuff), the voices are somewhat robotic sounding, but everything works fine with alsa on mine.  Then, my c1 at work doesn't work.  I get:
oss_audio: failed to open audio device /dev/dsp

My first build I didn't grab alsa-lib and it defaulted to an oss build which worked, only after killing the flash player since it had a hold on /dev/dsp.

Can anybody shed some light on the difference between 1.0.7 (broken) and engineering_regression_1.0.2726 (working) and why that engineering version wouldn't be updated automatically?  I suspect I put the custom firmware on there for the ntpd time drift months ago, but assumed it would update itself to newer versions as they were released.

Linux Guy - Occasional Chumby Hacker

Re: talking alarms?

Another point of fact, I don't show anything opening /dev/dsp, (no lsof, but using "ls -l /proc/*/fd | grep dsp") and that's for OSS, which this binary is compiled to use alsa and works on the c1 at home.  This is baffling me at this point and time, but I'm new to dealing w/ audio systems in linux.

Linux Guy - Occasional Chumby Hacker

Re: talking alarms?

@MaterDaddy: I first tried the flite files includes with the Talking Clock app, and followed your directions to compile flite from scratch. The Infocast returns the same error:
      audio_open_alsa: failed to set sample rate near 16000. Invalid argument.
The control panel was not running.

Re: talking alarms?

This is a somewhat old topic, but I found a simple solution for talking alarm.

1) create /psp/cgi-bin/gt :

#!/usr/bin/perl
print "Content-Type: audio/mp3\r\n\r\n";
@lt = localtime();
$t = sprintf("%d:%d", $lt[2], $lt[1]);
$t .= '..%20';
open(T, "/usr/bin/wget -q -U 'Lynx 1.2.3.4' -O - 'http://translate.google.com/translate_tts?tl=en&q=$t$t$t$t' |");
binmode(T);
while (read(T, $buf, 1024)) {
   print $buf;
}
close(T);

This script gets MP3 data talking the current time 4 times.
You may change the 'tl=' option for your language.

2) chmod a+x /psp/cgi-bin/gt

3) create a new entry in Music/My Streams:

Name: Thanks Google!
URL: http://127.0.0.1/cgi-bin/custom/gt
Type: MP3

4) use this stream for your alarm.

Re: talking alarms?

Hey, thanks for the help!  It may be old, but I'm sure someone will eventually stumble across this thread again via a Google search, and they'll be very happy to find your solution smile

Re: talking alarms?

Thanks to satou_takashi for a solution when connected to the Internet.
For my projects, I was trying to get a workable on-board software solution, but ran out of time.

Re: talking alarms?

I revised my code to cache MP3 data in order to avoid unintended DDoS attacks to Google :-)

#!/usr/bin/perl

print "Content-Type: audio/mp3\r\n\r\n";

@lt = localtime();
$f = sprintf("/mnt/usb/%d_%d.mp3", $lt[2], $lt[1]);
if (-f $f) {
    open(T, $f);
    $c = 0;
} else {
    open(F, ">$f");
    $c = 1;
    $t = sprintf("%d:%d", $lt[2], $lt[1]);
    $t .= '..%20';
    open(T, "/usr/bin/wget -q -U 'Lynx 1.2.3.4' -O - 'http://translate.google.com/translate_tts?tl=ja&q=$t$t$t$t' |");
}
while (read(T, $buf, 1024)) {
   print $buf;
   print F $buf if $c;
}
close(T);
close(F) if $c;

Please modify "/mnt/usb/" where to save the MP3 files.
After getting enough files, it works without Google text-to-speech service.