02-08-2011, 07:50 PM | #1 |
Enthusiast
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. |
02-08-2011, 08:04 PM | #2 |
Guru
Posts: 987
Karma: 8641
Join Date: Aug 2010
Device: Kindle 3G+WiFi
|
Not that it helps you but the Kindle uses Nuance Vocalizer Embedded for its text to speech. There are several large voice data files in /usr/share/nuance/data and /usr/share/tts/dict contains the dictionaries. 3.1 added some extra dictionary files so the TTS should in theory be better sounding.
Your best bet for a replacement TTS daemon would be basing it on something like Festival-lite or the full version of Festival. I'm unsure how good the support is for non English languages. Festival-lite only does English and Spanish by default. Festival is more flexible and can support more. Neither really sound that amazing however but its free... |
Advert | |
|
02-08-2011, 08:26 PM | #3 |
Enthusiast
Posts: 35
Karma: 1566
Join Date: Nov 2010
Device: kindle 3wifi
|
Thanks for your reply.
My motivation is to make it read Chinese text, which I think should be easy to implement, at least for a very basic implementation. Unlike other languages, each Chinese character sounds in only one syllable, and the total number of different sounding/phone of the characters are quite limited. So, for basically implementation, it's just a map between the character and the sound(s) of the character. |
02-08-2011, 08:36 PM | #4 |
Guru
Posts: 987
Karma: 8641
Join Date: Aug 2010
Device: Kindle 3G+WiFi
|
Ahh. I assume you want to keep the original TTS daemon around for reading English?
You should be able to open the FIFO in non blocking mode though? What are you doing? You'll have to poll or use select() however if it is in non blocking mode. Check that the reader actually keeps the FIFO open all the time when reading or whether it occasionally closes and reopens it due to some action or timer. |
02-08-2011, 08:42 PM | #5 | |
Enthusiast
Posts: 35
Karma: 1566
Join Date: Nov 2010
Device: kindle 3wifi
|
Quote:
Yes, I'm trying to see if it's closed. I might need a strace to see what the original TTS engine does. |
|
Advert | |
|
02-13-2011, 06:25 AM | #6 |
Member
Posts: 15
Karma: 10
Join Date: Dec 2010
Device: Kindle 3G, Nokia N810
|
Well, and what about other European languages? Slavic languages as Czech, Slovak, Russian or even Polish are easy-to-read languages. Each character (or the couple of characters in Polish) has in the most case only one sound.
|
02-14-2011, 12:20 PM | #7 |
Enthusiast
Posts: 35
Karma: 1566
Join Date: Nov 2010
Device: kindle 3wifi
|
Well, this problem is more complicated than I thought. By ld_preload tricks, I can get the text stream between the reader and the ttsd. However, the control information are transfered by DBus, which I don't have enough knowledge/time to investigate yet.
|
03-16-2011, 04:05 PM | #8 |
Junior Member
Posts: 1
Karma: 10
Join Date: Mar 2011
Device: kwok2008@gmail.com
|
Why don't you just install Duokan? (see elsewhere on this forum for instructions). Three benefits straight off the bat: 1) It doesn't wipe out the official firmware, ie it is switchable between the two 2) Duokan supports ePub format and... 3) Duokan has Mandarin, Cantonese and English Text-to-Speech!
|
03-17-2011, 08:06 PM | #9 | |
Enthusiast
Posts: 35
Karma: 1566
Join Date: Nov 2010
Device: kindle 3wifi
|
Quote:
You may argue that Duokan team is very responsive on the problems, but who are behind the Duokan team? What if they just stop supporting? I wouldn't install Duokan until they open source the project. On their forum, they said they would open source it step by step, but I would wait before that happens! |
|
04-30-2011, 02:36 AM | #10 |
Wizard
Posts: 1,669
Karma: 2300001
Join Date: Mar 2011
Location: Türkiye
Device: Kindle 5.3.7
|
deleted
Last edited by thomass; 04-30-2011 at 02:41 AM. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Text to Speech | briteflint | Calibre | 3 | 05-24-2010 02:56 PM |
K2 Text to Speech | SarahW | Amazon Kindle | 5 | 04-23-2010 10:18 PM |
No more text to speech??? | pippin65 | Amazon Kindle | 22 | 11-16-2009 04:27 PM |
Text to speech | Chelley | Introduce Yourself | 5 | 03-09-2009 12:33 PM |