Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle > Kindle Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 02-08-2011, 08: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
Old 02-08-2011, 09:04 PM   #2
Tiersten
Guru
Tiersten shines like a glazed doughnut.Tiersten shines like a glazed doughnut.Tiersten shines like a glazed doughnut.Tiersten shines like a glazed doughnut.Tiersten shines like a glazed doughnut.Tiersten shines like a glazed doughnut.Tiersten shines like a glazed doughnut.Tiersten shines like a glazed doughnut.Tiersten shines like a glazed doughnut.Tiersten shines like a glazed doughnut.Tiersten shines like a glazed doughnut.
 
Posts: 987
Karma: 8641
Join Date: Sep 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...
Tiersten is offline   Reply With Quote
Old 02-08-2011, 09:26 PM   #3
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
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.
kindle3zeng is offline   Reply With Quote
Old 02-08-2011, 09:36 PM   #4
Tiersten
Guru
Tiersten shines like a glazed doughnut.Tiersten shines like a glazed doughnut.Tiersten shines like a glazed doughnut.Tiersten shines like a glazed doughnut.Tiersten shines like a glazed doughnut.Tiersten shines like a glazed doughnut.Tiersten shines like a glazed doughnut.Tiersten shines like a glazed doughnut.Tiersten shines like a glazed doughnut.Tiersten shines like a glazed doughnut.Tiersten shines like a glazed doughnut.
 
Posts: 987
Karma: 8641
Join Date: Sep 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.
Tiersten is offline   Reply With Quote
Old 02-08-2011, 09:42 PM   #5
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
Quote:
Originally Posted by Tiersten View Post
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.
Right, I want to keep the original TTS for English. So what I plan to do is to my daemon reads text stream from reader, and take the Chinese part out and read it, send the rest of the stream to the original TTS engine.

Yes, I'm trying to see if it's closed. I might need a strace to see what the original TTS engine does.
kindle3zeng is offline   Reply With Quote
Old 02-13-2011, 07:25 AM   #6
xlendi
Member
xlendi began at the beginning.
 
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.
xlendi is offline   Reply With Quote
Old 02-14-2011, 01:20 PM   #7
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
Quote:
Originally Posted by xlendi View Post
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.
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.
kindle3zeng is offline   Reply With Quote
Old 03-16-2011, 05:05 PM   #8
kwokmeister
Junior Member
kwokmeister began at the beginning.
 
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!
kwokmeister is offline   Reply With Quote
Old 03-17-2011, 09:06 PM   #9
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
Quote:
Originally Posted by kwokmeister View Post
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!
Well, among all these good things, it has one bad thing: it's not open source! I have no idea what it would do to my device, and I don't know whom I should turn to in case of problems!

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!
kindle3zeng is offline   Reply With Quote
Old 04-30-2011, 03:36 AM   #10
thomass
Wizard
thomass ought to be getting tired of karma fortunes by now.thomass ought to be getting tired of karma fortunes by now.thomass ought to be getting tired of karma fortunes by now.thomass ought to be getting tired of karma fortunes by now.thomass ought to be getting tired of karma fortunes by now.thomass ought to be getting tired of karma fortunes by now.thomass ought to be getting tired of karma fortunes by now.thomass ought to be getting tired of karma fortunes by now.thomass ought to be getting tired of karma fortunes by now.thomass ought to be getting tired of karma fortunes by now.thomass ought to be getting tired of karma fortunes by now.
 
Posts: 1,644
Karma: 1928003
Join Date: Mar 2011
Location: Türkiye
Device: Kindle 5.3.7
deleted

Last edited by thomass; 04-30-2011 at 03:41 AM.
thomass is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Text to Speech briteflint Calibre 3 05-24-2010 03:56 PM
K2 Text to Speech SarahW Amazon Kindle 5 04-23-2010 11:18 PM
No more text to speech??? pippin65 Amazon Kindle 22 11-16-2009 05:27 PM
Text to speech Chelley Introduce Yourself 5 03-09-2009 01:33 PM


All times are GMT -4. The time now is 09:05 PM.


MobileRead.com is a privately owned, operated and funded community.