View Single Post
Old 01-30-2013, 02:24 AM   #12
Lupines
Member
Lupines never is beset by a damp, drizzly November in his or her soul.Lupines never is beset by a damp, drizzly November in his or her soul.Lupines never is beset by a damp, drizzly November in his or her soul.Lupines never is beset by a damp, drizzly November in his or her soul.Lupines never is beset by a damp, drizzly November in his or her soul.Lupines never is beset by a damp, drizzly November in his or her soul.Lupines never is beset by a damp, drizzly November in his or her soul.Lupines never is beset by a damp, drizzly November in his or her soul.Lupines never is beset by a damp, drizzly November in his or her soul.Lupines never is beset by a damp, drizzly November in his or her soul.Lupines never is beset by a damp, drizzly November in his or her soul.
 
Posts: 21
Karma: 59588
Join Date: Jan 2013
Device: Kindle Keyboard 3G+Wifi
Lightbulb Text to speech for the kindle keyboard

I was able to cross compile flite. flite is a text-to-speech software
that can be used in embedded software. I compiled it static so no
libraries are needed. There is a bug that makes flite not to run on the
first try. So for example if you run something like:

# ./flite -t "Hello world!"

You will hear nothing. But if you run it one more time, it works.
I must be doing something wrong, or the libraries, or the binary,
or the kindle. If you find out, please let everybody know on this post.

Have fun,
Lupines

---------------------------------------------------------

Here are all the binaries for the lazy.

You have to put all this into /mnt/us/ and it will work.

https://mega.co.nz/#!vN8D2IoL!JucwYkjUNUCrBk5mT6Tk9HBRvvpaKA6Hth0O4hi H2M4

KEY: JucwYkjUNUCrBk5mT6Tk9HBRvvpaKA6Hth0O4hiH2M4

BUT!!! You only need this binary in order for it to work:

https://mega.co.nz/#!HNFAELIa!eq019nC4U3F68dehDKufX1zjpphaATOrOmlDDyk T0Ug

KEY: eq019nC4U3F68dehDKufX1zjpphaATOrOmlDDykT0Ug

Mirror for both files -> ge.tt/86zHm1X

Please refer to the flite instructions on how to
use it here:

http://www.speech.cs.cmu.edu/flite/doc/flite_7.html

----------------------------------------------------------
Now, if you are REALLY brave and want to compile it from scratch
here are the instructions on how to build it from source.

INSTRUCTIONS FOR THE CROSS COMPILER

I got the cross compiler instructions for ARM from here:

http://wiki.debian.org/BuildingCrossCompilers#Installing_a_Cross_Compiler

----------------------------------------------------------

COMPILING INSTRUCTIONS FOR alsa-lib

Since the Kindle works under ALSA for audio, you must have a cross compiled
version of alsa-lib-1.0.13. I believe a newer version of the ALSA libs
could be used. I just tried this one and it works (sorta, read the end of
the post)

# wget http://gd.tuwien.ac.at/opsys/linux/a...1.0.13.tar.bz2

# bunzip2 alsa-lib-1.0.13.tar.bz2 ; tar -xvf alsa-lib-1.0.13.tar

# cd alsa-lib-1.0.13

# ./configure --with-audio=alsa --prefix=/usr/local/arm-linux --host=arm-linux CC=arm-linux-gnueabi-gcc \
GCC=arm-linux-gnueabi-g++ CFLAGS=-DEMBEDDED CFLAGS="-I/usr/local/arm-linux/include" \
LDFLAGS="-L/usr/local/arm-linux/lib" LD_LIBRARY_PATH="/usr/local/arm-linux/lib"

# make

# make install

-----------------------------------------------------------

COMPILING INSTRUCTIONS FOR flite

First, you have to get flite-1.4.tar.gz

# wget http://www.speech.cs.cmu.edu/flite/p...elease.tar.bz2

# bunzip2 flite-1.4-release.tar.bz2 ; tar -xvf flite-1.4-release.tar

# cd flite-1.4-release

First the /configure file needs to be changed. All the options for the
different audio drivers must be removed. I just erased all of them and
left this one:

AUDIODRIVER="alsa"
AUDIODEFS=-DCST_AUDIO_ALSA
AUDIOLIBS=-lasound

Using --with-audio=alsa didn't work for me. But I included in the
./configure anyways.

These are the options I used for cross compiling flite:

# ./configure --with-audio=alsa --prefix=/usr/local/arm-linux --host=arm-linux CC=arm-linux-gnueabi-gcc \
GCC=arm-linux-gnueabi-g++ CFLAGS=-DEMBEDDED CFLAGS="-I/usr/local/arm-linux/include" \
LDFLAGS="-L/usr/local/arm-linux/lib/alsa-lib" LD_LIBRARY_PATH="/usr/local/arm-linux/lib/alsa-lib" \
LDFLAGS="-L/usr/local/arm-linux/lib" LD_LIBRARY_PATH="-L/usr/local/arm-linux/lib"

Run make (remember that this must be gnu make or gmake)

# make

This make will fail, and these are the instructions to fix it.

---------------
Some of the files on flite need to be modified in order to get this to compile.

# cd tools

And change the Makefile inside /tools

this:
$(CC) $(CFLAGS) -o $@ find_sts_main.o $(FLITELIBFLAGS) $(LDFLAGS)
for this:
$(CC) -L/usr/local/arm-linux/lib $(CFLAGS) -o $@ find_sts_main.o $(FLITELIBFLAGS) $(LDFLAGS)

and also,

this:
$(CC) $(CFLAGS) -o $@ flite_sort_main.o $(FLITELIBFLAGS) $(LDFLAGS)
for this:
$(CC) -L/usr/local/arm-linux/lib $(CFLAGS) -o $@ flite_sort_main.o $(FLITELIBFLAGS) $(LDFLAGS)
---------------
Then you have to change the Makefile inside /main

this:
$(CC) $(CFLAGS) -o $@ flite_main.o flite_voice_list.o $(flite_LIBS_flags) $(LDFLAGS)
for:
$(CC) -L/usr/local/arm-linux/lib $(CFLAGS) -o $@ flite_main.o flite_voice_list.o $(flite_LIBS_flags) $(LDFLAGS)

this:
$(CC) $(CFLAGS) -o $@ flite_time_main.o $(flite_time_LIBS_flags) $(FLITELIBFLAGS) $(LDFLAGS)
for:
$(CC) -L/usr/local/arm-linux/lib $(CFLAGS) -o $@ flite_time_main.o $(flite_time_LIBS_flags) $(FLITELIBFLAGS) $(LDFLAGS)

this:
$(CC) $(CFLAGS) -o $@ t2p_main.o $(flite_LIBS_flags) $(LDFLAGS)
for:
$(CC) -L/usr/local/arm-linux/lib $(CFLAGS) -o $@ t2p_main.o $(flite_LIBS_flags) $(LDFLAGS)

this:
$(CC) $(CFLAGS) -o $@ compile_regexes.o $(FLITELIBFLAGS) $(LDFLAGS)
for:
$(CC) -L/usr/local/arm-linux/lib $(CFLAGS) -o $@ compile_regexes.o $(FLITELIBFLAGS) $(LDFLAGS)

this:
$(CC) $(CFLAGS) -o $@ flite_main.o flite_voice_list.o $(flite_LIBS_flags) $(LDFLAGS)
for:
$(CC) -L/usr/local/arm-linux/lib $(CFLAGS) -o $@ flite_main.o flite_voice_list.o $(flite_LIBS_flags) $(LDFLAGS)

And finally...

# sudo make install
----------------------------------------------

Last edited by Lupines; 01-31-2013 at 01:02 AM.
Lupines is offline   Reply With Quote