I've been working on the last couple of days to get text-to-speech working for other languages other than English. So far I got this.
Using the gstreamer framework I was able to play MP3 and WAV files, I didn't try with other formats, but I believe it is doable. The Kindle uses the ALSA sound system.
-How to play mp3 files
# gst-launch filesrc location=your_sound_file.mp3 ! decodebin ! audioconvert ! audioresample ! alsasink
-How to play wav files
# gst-launch filesrc location=your_sound_file.wav ! wavparse ! alsasink
For the text to speech part.
I used a software called mbrola. This is a speech synthesizer with support for many languages. They only provide the software in binary form. But an ARM binary is available here:
In order to get mbrola working, a voice needs to be downloaded. There are several available here:
I picked the one for Spanish called "es2"
Inside the es2-989825.zip file you will find that there is the actual voice file called "es2"
and there is a TEST directory. To execute an example you must do:
# ./mbrola es2 TEST/example1.pho test.wav
This will execute the mbrola synthesizer, using the es2 spanish voice, using the phonetic example1 file,
and creating a test.wav file as output.
Now lets say that we want all these together, using mbrola for reading our example1.pho file and listening the output on the kindle speakers.
For this, you must combine both things, mbrola+gst-launch.
# ./mbrola es2 example1.pho test.wav | gst-launch filesrc location=test.wav ! wavparse ! alsasink
I am still working on getting a regular text file to its phonetic form. So please don't post questions asking how to configure this on the kindle to get it to read in other languages. I don't know yet. This is just a first step towards that. Everybody is welcome to help out on the effort.