OUR NETWORK:TechLore Explore3DTV MyOpenRouter MediaSmart home TiVoCommunity See all... About UsAdvertiseContact Us

 
Learn about scoring Forum's Raw Score: 2080540.0
December 22, 2009 08:56 AM

Categories: RS Media

Rating (3 votes)
  • 1
  • 2
  • 3
  • 4
  • 5
Rate This!

Member Avatar

Helibot

Member
Joined: 03/12/2009

Hi All,

   I have a christmas present for you all... RSMedia can now say anything you type in!!!

 I finally got the 'flite' text to speech synthensier program working for RSMedia.
So you can type flite -t "Hello world, I am now a talking robot"  and he says exactly that!!
The voice is very 'electronic' but understandable (most of the time!).

I have uploaded the program to sourceforge. Just download the zip file from here. (4Mb download)
See the flite_rsmREADME.TXT file in the archive to see how to use it.

In the archive I have included a few wav files of some example output. Here are the command I used to generate them:-
 ./flite_rsm -t "the lazy fox jumped over the brown cow" /tmp/test.wav
 ./flite_rsm -t "Hello I am are ess Media and thank to f lite I can finally talk" /tmp/hello_flite.wav
./flite_rsm -t "Merry christmas and happy New year to you all" /tmp/merryxmas.wav
(If you specify a file name at the end of the command then the data is written to a file. If no file is specified then the wav file is played immediately)

So please download it and have a play....You will need the USB console to be able to type the commands in.

I hope you all have a VERY MERRY (& CHATTY) CHRSTMAS AND A HAPPY NEW YEAR!

I have put some notes and details of the modifications needed to build the working RSMeida version here 

Cheers
    Helibot

Here is a brief background on the Flite text to speech program:-
See the web page here http://www.speech.cs.cmu.edu/flite/
The released version of flite 1.0 for ARM runs on RSMedia , but it runs at double speed, so he talks really quickly.
 I eventually fixed this - by forcing Flite to output stereo data (instead of mono). I also fixed a few other issues - it seems that RSMedia Audio driver is not quite 100% linux compatible, or maybe it is just very old??) 

Note - There are newer flite versions 1.1,1.2 & 1.3 but none of these work when recompiled for RSMedia. But I may be able to get them to work now (since I have learned a bit about how the program works!). These newer versions have more features so its probably worth doing, so its on my todo list!!

Discussion:    Add a Comment | Comments 1-25 of 34 | Latest Comment | 1 2 Next »

December 22, 2009 11:52 AM

Great! I'll be trying this tonight.

Santa Matt
Jolly old fat man

December 22, 2009 2:58 PM

This is outstanding. I tried it out already and i't works perfectly. I cant wait to have it read my email (somehow).

Two notes on the tts;
1) I cant believe my RSM talks now.
2) ./flite-rsm -t "this is so freek'n awesome that I cant stop playing with it"

December 22, 2009 3:07 PM

This sounds familiar, take a guess from what movie this line is from.
./flite_rsm -t "Do you want to play a game?"

December 22, 2009 4:03 PM

FreddyA said: This sounds familiar, take a guess from what movie this line is from. ./flite_rsm -t "Do you want to play a game?"

War Games!

Santa Matt
Jolly old fat man

December 22, 2009 4:27 PM

Yep, the RSM tts voice tone is similar to WOPR / Joshua.

December 22, 2009 6:36 PM

The docs on flite state that the voice included is very poor. But that it should be compatible with other (higher quality) 'vox' voices availble for 'Festival'. So it should be possible to get better/different voices.....

Cheers
Helibot

December 22, 2009 6:46 PM

Wow, Christmas came early this year! Thanks for this Helibot, and making it easy for us novice programmers to use!

December 22, 2009 7:20 PM

I can understand the voice pretty well, and it would be cool to have additional choices.

December 22, 2009 8:58 PM

I found quite a few words thae flite doesnt understand or synthersie well, to get him to say them better you can spell them phonetically (eg 'are ess media' worked well for 'RSMedia').
You can also make it say the words saved in a file by using
./flite_rsm -f /tmp/words.txt
But if you make the sentances too long , I think it will slow down while he is talking or lose some words.

Cheers
Helibot

December 22, 2009 9:06 PM

Could you enter commands in the V2 Alarm config file to run flite speech commands? Love that ini file so easy to add and edit stuff.

December 22, 2009 9:51 PM

Hi Robostuff,
It should work OK if you use the format flite_rsm -f filename.
If you use flite_rsm -t "hello" then the I think the quotes ('"') may get lost.
So you would need

[alarm01]
action = SPEAK:
...
[actioncmds]
SPEAK = ./flite_rsm -f
or
SPEAK = /mnt/sd/Application/flite_rsm -f

I'll be offline for a Xmas break now , so I hope you all have a great christmas.
So I'll let RSMedia do the talking for now :-)....

Cheers
Helibot

December 23, 2009 3:25 AM updated: December 23, 2009 3:25 AM

Great work, Helibot!

It's really a dream come true. Fantastic Christmas gift for Community!

So, Merry Chirstmas and Happy New Year to you!!!

(P.S. It's not my cat, just found on the Net)

December 23, 2009 10:25 AM

Thats a cool pic, time to revise the cool cats pictures thread. I think he is sleeping happily now that his RS Media can finally speak lol

December 23, 2009 5:33 PM

This is INCREDIBLE! SUPERB!
It's almost like going from bicycle to motorcycle !!!

Sorry for my not quite fitted comparison.

Horia Pernea
http://www.roboticage.eu

January 4, 2010 7:42 AM

Hi All,
   I have now got Flite v1.3 working. I think it sounds a bit better and runs a bit quicker. 

I have also compiled the flite_time program - this is a demo program that comes with flite. It reads out the time in a human friendly format. The voice in the time program is better than the flite_rsm program - it sounds very natural (in comparison). So its interesting to have a listen too. It would be good to use this for a RSMAlarmClock action - it could speak the time for an alarm, or use  recurring alarm to tell you the time each hour.

Download the flite_rsm_1.3 from here.
Download the flite_time_rsm from here.

The source and instructions for the V1.3 changes are also in sourceforge site here.

I have also just read that there is also a version 1.4 of flite that includes three (yes 3) different voices ......So I think this should be tried on RSMedia as well.
Any volunteers to try compiling and running it?
(I have started looking at Networking again, so I want to keep going on that) 

BTW I had an absolute hoot of a time making the robot talk my 4yr old son yesterday.... my son was answering him back and laughing his head off (while I was typing madly and trying to keep a straight face!). In the end my son agreed the robot could take his photo , but he wouldnt believe the robot when he told him it was bedtime! 

 Cheers
    Helibot

January 4, 2010 7:59 AM

Hi All,
  Just a quick note to say that the Flite program is setup so most of it is in a library, so it should be quite easy to include the library into another C program and have that program speak text, I think you will just need a few lines of C to make it happen.

   Also I summerised some of the commands that the RSMedia audiodevice supports (and doesnt support). Its probably useful to anyone else wanting to write (or port) audio programs for RSMedia.

Here is some info:-
   It only supports Stereo output (if you set mono it plays it as stereo and everything sounds twice as fast).
   It supports at least 16bit signed data.
   It supports at least 16Khz and 32Khz - it does not support 8Khz (if you set 8Khz it plays it really fast (at 32khz I guess?)
  It doesnt support any IOCTRL GETS (but does support some SETS).

Here is a list of what I found was and wasnt supported:-

  • SNDCTL_DSP_RESET - OK
  • SNDCTL_DSP_SYNC - Fails (it does NOT seem to block the caller until all data is processed.)
  • SNDCTL_DSP_SETFMT - Ok (at least AFMT_S16_LE does work)
  • SNDCTL_DSP_CHANNELS - OK (1=Mono , 2 = stereo)
  • SNDCTL_DSP_STEREO -Fails (returns -1)
  • SNDCTL_DSP_SPEED - OK (at least 16000,22050 and 32000 work. Note that 8000 does not work)
  • SNDCTL_DSP_SETFRAGMENT - Unknown? (can be set successfully but the settings does not seem to affect behaviour at all)
  • SNDCTL_DSP_GETFMTS -Fails (returns -1)
  • SNDCTL_DSP_GETISPACE -Fails (returns -1)
  • SNDCTL_DSP_GETOSPACE -Fails (returns -1)
January 4, 2010 6:20 PM

Thanks helibot, I can tell the difference and the voice for the time is quite believable. Could you give an example of how to have it say the time every hour by recuring alarm? Or even for it to announce the alarm time? I tried a new actioncmd:
SPEEKTIME = /mnt/sd/Application/flite_time_rsm -t
and
action = SPEEKTIME:flite_time_rsm 06:00
Also, any chance for 12/24 hour option later? I would give the 1.4 a go but it is a huge learning curve beyond me now.
Keep up the work on that ppp, it will be interesting to see the ideas that will fly. I've had a good time with this new stuff you are doing thanks Helibot

January 5, 2010 5:49 AM updated: January 5, 2010 5:50 AM

Hi Freddy,

We need a way to get the current time in the format HH:MM. Fortunately the linux date command can do this. Use date +%0H:%0M will output 23:09 at 11:09pm.

   So using this we can make the commands for a recurring alarm.
[alarm1]
#Recuring alarm to speak the time on the hour
enabled = Y
time = 8:00
action = TIME_:
recur = 60m

...
[action]
action = TIME_:./flite_time_rsm "`date +%0H:%0M`"

I think you could also use
[alarm1]
#Recuring alarm to speak the time on the hour
enabled = Y
time = 8:00
action = NOCMD:./flite_time_rsm "`date +%0H:%0M`"
recur = 60m

(By the way I have NOT checked these actually work in an alarm. Let me know if they dont!! I have checked that ./flite_time_rsm `date +%0H:%0M` from the command line does actually say the time correctly.)

BTW Freddy - You tried to use "SPEEKTIME" for the action name, but this wont work - because the length MUST be exactly 5 characters. So SAY__ or SPEAK or TIME_ would all be OK.

Cheers
   Helibot

January 5, 2010 4:53 PM

Helibot, Thanks for clearing that up I did get some results from those examples. The NOCMD has not worked for me yet but by using 5 characters the new actioncmds works using ./flite_time_rsm `date +%0H:%0M` I've got it telling me the time every 30m its great. Thanks again.

January 5, 2010 11:00 PM

Hey Helibot, I've been trying to get a random tts alarm going. Here is what i've been trying.

[alarm19]
enabled = Y
action_rnd = NOCMD:/mnt/sd/Application/Random
recur = 2m
recurcount = 10

I placed a folder nemed Random with several .sh files containing this script SPEEK:./flite_rsm_1.3 -t "random text" (made with santa matt's editor)

Also tried just ./flite_rsm_1.3 -t "random text" but no go

What would I be doing wrong?

January 6, 2010 5:09 AM updated: January 6, 2010 5:10 AM

Hi Freddy,
I think if you have the .sh file to contain just the line
/mnt/sd/Application/flite-bin/flite_rsm_1.3 -t "hello world"
(Also I must admit I have not tried random with NOCMD: action. So maybe there is a bug in the alarmclock program?)

So you should also be able to use the -f feature of flite. This is probably the best solution.....
Use action_rnd = SAY_F:/mnt/sd/Application/Random
and define
[action]
action = SAY_F:./flite_time_rsm -f

Finially make files in .../Applictation/Random directory. Each file should contain the text you want the robot to say. Eg if you want to have it say good evening then make a file with just the words "good evening" in it. Call the files anything you like (but I would avoid putting spaces in the file names).
(Once again I havent tried this but it should work!!!)

Cheers
Helibot

January 6, 2010 4:38 PM

Hey Helibot, I got NOCMD to work with your first suggestion but the second example had a problem where it reads additional string info before and after the random text file and i did change from your example the /flite_time_rsm -f to /flite_rsm_1.3 -f. Now the NOCMD works like a charm as random action, says the time every 30m and blurts out random text every 5 minutes. Thanks for your help this is awesome.

January 7, 2010 3:10 AM

Hi Freddy,
Great, I'm glad all working for you. Could you post the working ini file sections here I and others can see how you got it going?
Cheers
Helibot

January 7, 2010 7:08 PM

ok here it is. I made this alarm

[alarm19]
enabled = Y
action_rnd = NOCMD:/mnt/sd/Application/Random
recur = 40s

this action

SPEEK = ./flite_rsm_1.3 -f

And a folder named Random in the application folder containing several .sh files with this

/mnt/sd/Application/flite_rsm_1.3 -t "your text here"

That works for me and in this case I have 11 files in the Random folder and it says them at randome every 40 seconds.

And on one .sh file I put a take picture action and more text after and it will say the text, take a picture and say the rest of the text. Very cool possibilities just on the verge.

January 7, 2010 9:16 PM

For the Flite time I used this alarm

[alarm16]
time = 7:00am
enabled = Y
action = SPKTM:
recur = 30m
recurcount = 26

and this action

SPKTM = /mnt/sd/Application/flite_time_rsm `date +%0H:%0M`

This one will say the time every half hour from 7am to 8pm I think and stops, starts over the next day at 7 again. works nicely

Discussion:    Add a Comment | Back to Top | Comments 1-25 of 34 | Latest Comment | 1 2 Next »

Add Your Reply

(will not be displayed)

Email me when comments are added to this thread

 
 

Please log in or register to participate in this community!

Log In

Remember

Not a member? Sign up!

Did you forget your password?

You can also log in using OpenID.

close this window
close this window