View Single Post
Old 02-08-2011, 07:50 PM   #1
kindle3zeng
Enthusiast
kindle3zeng once ate a cherry pie in a record 7 seconds.kindle3zeng once ate a cherry pie in a record 7 seconds.kindle3zeng once ate a cherry pie in a record 7 seconds.kindle3zeng once ate a cherry pie in a record 7 seconds.kindle3zeng once ate a cherry pie in a record 7 seconds.kindle3zeng once ate a cherry pie in a record 7 seconds.kindle3zeng once ate a cherry pie in a record 7 seconds.kindle3zeng once ate a cherry pie in a record 7 seconds.kindle3zeng once ate a cherry pie in a record 7 seconds.kindle3zeng once ate a cherry pie in a record 7 seconds.kindle3zeng once ate a cherry pie in a record 7 seconds.
 
Posts: 35
Karma: 1566
Join Date: Nov 2010
Device: kindle 3wifi
Localize Text-to-Speech

Currently, Text-to-Speech only supports English.

I'm experimenting to extend it to other languages, and this is what I found so far.

The speech is produced by a ttsd server, which reads input from a named pipe file /var/tmp/ttsUSFifo, and the reader write the text stream with control information embedded in the stream to the FIFO.

First, we need to break the tie between the reader and the tts server.
The first method I tried is:
1. try to make ttsd read from another pipe, this is the hardest part, I tried with gdb, to close the current fd associated with /var/tmp/ttsUSFifo, and open a new fd with a FIFO (say, /var/tmp/ttsFifo), but I can only open that FIFO in non-block way; then dup2 the new fd to the original fd.
2. write a bridge program, which reads from /var/tmp/ttsUSFifo, and writes to /var/tmp/ttsFifo.

this method doesn't work for some unknown reasons, so I tried to modify the ttsd to ask it to read from somewhere else. Since it seems the path is hardcoded in the executable file. I only changed a letter from /var/tmp/ttsUSFifo to /var/tmp/ttsVSFifo, and it worked, well kind of.

The problem I ran into with the second method is that it stopped reading after
a period of time, and my bridge read a EOF from the /var/tmp/ttsUSFifo.

I recorded a segment of text stream from the reader, and I found that it did send out the all text, even if it's not in English, and it's just the tts server that ignored the non-english text. So in principle, we can extend the text-to-speech by writing our own tts server.
kindle3zeng is offline   Reply With Quote