[sugar] New multilingual dictionary activity

Joshua Minor j
Mon Mar 10 00:42:42 EDT 2008


On Mar 9, 2008, at 1:33 PM, Chris Ball wrote:
>   * I have a "Speak" button that I'd like to hook up to espeak with  
> the
>     appropriate accent loaded.  Josh, any interest in helping to get
>     that working?  Should I just wait for the speech server?

I would wait for the speech server before you get elaborate.  If you  
want a placeholder that will actually work you can use something like  
this:

import os, subprocess

def say(something):
   tmpfile = "/tmp/something.wav"
   subprocess.call(["espeak", something, "-w", tmpfile])
   subprocess.call(["aplay", tmpfile])
   os.unlink(tmpfile)

If you want to try other accents, run "espeak --voices" to list the  
available ones and then use the -v option to pick one when you run  
it.  There is code in Speak.activity that will filter the voice list a  
bit, but speechd will do a much better job of this.

-josh




More information about the Sugar-devel mailing list