Re: Read Etexts now supports Text To Speech

2008-06-10 Thread Edward Cherlin
On Mon, Jun 9, 2008 at 9:09 AM, James Simmons [EMAIL PROTECTED] wrote:
 I know there are several people interested in having Text to Speech with
 Karaoke highlighting be a built in part of the Sugar environment.  Also,
 when I originally requested a Git repository for the Read Etexts
 activity Ed asked if text to speech with highlighting would be
 supported.  I was reluctant to commit to that at the time, thinking it
 would be too difficult.  It turned out to be both easier and more
 difficult than I thought it would be, but I have released version 4 of
 the activity which now supports TTS with the words highlighted as they
 are spoken.

Wonderful news. Now we have to talk to management about getting a
project created to support more languages. Perhaps organized like
Pootle, but with entirely different software. The idea is that we need

* a linguistic analysis of the sound system of the language, or of any
particular dialect
* a script containing all of the sounds of the language for informants
to read for recording
* a process to create the files for the speech engine in the appropriate format
* a dictionary and an orthography engine to convert from the written
language to the required sound sequence. There will still be
ambiguities that would require strong AI to resolve. He wound the
bandage around the wound is a simple example of the problem.

 The code could be improved, no doubt.  I am fairly new to Python
 programming.  But I think trying out this Activity could give you some
 idea of what to expect if you attempt to incorporate TTS as part of the
 Sugar interface.

 1).  Speech-dispatcher needs to run in a separate thread from the GTK
 event loop, otherwise the callbacks needed to highlight words won't be
 received.
 2).  To get the callbacks as each word is spoken you need to format the
 text to be spoken as an XML document with tags *before* each word.  My
 code assumes that words are separated by whitespace, which works for
 many languages but not all of them.  I know Sanskrit doesn't work that
 way, for instance.

Nor Chinese, nor Thai, nor a number of others.

 3).  Espeak does not allways do a callback for each word, and there is
 no obvious reason why any given word would be skipped.  I understand
 that Festival works better, but I haven't tried it.  At the suggestion
 of Hynek Hanke of the speech-dispatcher project I made the tag ids for
 each tag correspond to the word number in the document.  In this way I
 can get the tag id in the callback and always highlight the correct word
 even if occasionally words are skipped over by espeak.
 4).  Pausing and resuming speech doesn't work.  No idea why.
 5).  The instructions for setting up speech-dispatcher on the wiki are
 obsolete.  You cannot use espeak-generic module with speech-dispatcher
 and get callbacks.  You need to use the normal espeak module.  When you
 try to use the normal espeak module with the current RPMs
 speech-dispatcher complains of a missing library.  So if you want to try
 my Activity you'll need to use sugar-jhbuild with speech-dispatcher
 installed and configured to use espeak.

 Hemant Goyal is working on creating RPMs for speech-dispatcher and will
 be updating the instructions on the wiki.

Is anybody interested in making the Debian/Ubuntu packages? This would
be one of my favorite demos.

 The Activity page is: http://wiki.laptop.org/go/Read_Etexts

 James Simmons



 ___
 Devel mailing list
 Devel@lists.laptop.org
 http://lists.laptop.org/listinfo/devel




-- 
Edward Cherlin
End Poverty at a Profit by teaching children business
http://www.EarthTreasury.org/
The best way to predict the future is to invent it.--Alan Kay
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: Read Etexts now supports Text To Speech

2008-06-10 Thread James Simmons

Edward,

Ubuntu packages are already available for speech-dispatcher, espeak, and 
festival, so it isn't difficult to set up a demo.  You can use apt-get.  
You would have to modify a configuration file to use the espeak module 
(not espeak-generic) and you would have to start speech-dispatcher by 
hand before doing the demo.  There is a way to get it started 
automatically, but I never bothered to find out what it is.  The 
instructions on the wiki are *close* to being right.  Just substitute 
using the espeak module for espeak-generic and don't bother modifying 
the espeak config file.


Hemant's RPMs will be specifically for the XO.  Having special RPM's for 
the XO is desireable because we don't have a lot of disk space to work 
with and the usual package for speech-dispatcher brings in festival and 
other stuff that wouldn't be needed.  This isn't a problem for ubuntu or 
debian running on a regular PC.


I don't think current speech software is up to saying wound around the 
wound yet.  I've tested with with Thuvia, Maid of Mars, Edison's 
Conquest of Mars, and Triplanetary and I've been impressed with how 
well the software deals with made-up words like you find in science 
fiction (Dusar, Ptarth), but I've also heard it pronounce 
micrometer as micro meter.  For a kid learning to read I think it 
should be OK.  But we have to have realistic expectations.  I would love 
for the XO to sound like Hal 9000 (What do you think you're doing, 
Dave?) but I'll settle for Colossus The Forbin Project, which is pretty 
much what it sounds like.


I've thought a bit more about highlighting for languages that don't 
split words.  I convert my text one page at a time to SSML, using 
whitespace, but it should be possible to do just the oppposite: accept a 
document already in SSML and convert it to plain text for display.  That 
way actual humans could figure out where the words split.


Hemant was going to create a control panel for speech-dispatcher that 
allows you to set speech rate, voice used, etc.  I was planning on using 
that so I didn't have to provide those options in my Activity.  If that 
doesn't work out for some reason I was thinking of swiping one of the 
toolbars in the Speak activity and modifying that.  Speech-dispatcher by 
default speaks very quickly, which I think is the preference for 
visually impaired people.  I slowed it down quite a bit.  Somehow or 
other this needs to be adjustable.  Plus I need to get pause and resume 
working.


James Simmons


Edward Cherlin wrote:


Hemant Goyal is working on creating RPMs for speech-dispatcher and will
be updating the instructions on the wiki.
   



Is anybody interested in making the Debian/Ubuntu packages? This would
be one of my favorite demos.
 

___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: Read Etexts now supports Text To Speech

2008-06-10 Thread Hemant Goyal
Hi Edward,


 Ubuntu packages are already available for speech-dispatcher, espeak, and
 festival, so it isn't difficult to set up a demo.  You can use apt-get.  You
 would have to modify a configuration file to use the espeak module (not
 espeak-generic) and you would have to start speech-dispatcher by hand before
 doing the demo.  There is a way to get it started automatically, but I never
 bothered to find out what it is.  The instructions on the wiki are *close*
 to being right.  Just substitute using the espeak module for espeak-generic
 and don't bother modifying the espeak config file.


The debian package information is available here:

 http://packages.debian.org/stable/sound/speech-dispatcher OR

http://www.freebsoft.org/pub/projects/speechd/snapshot-debian/

Hemant's RPMs will be specifically for the XO.  Having special RPM's for the
 XO is desireable because we don't have a lot of disk space to work with and
 the usual package for speech-dispatcher brings in festival and other stuff
 that wouldn't be needed.  This isn't a problem for ubuntu or debian running
 on a regular PC.


Actually the RPM package at the moment is being made for the Fedora
community in general. Once that is done, perhaps a special package with less
features for OLPC can be made quite easily.

Best,
Hemant
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel