Tuesday, June 5, 2007

FLITE (Text-To-Speech)

I am writing an application for my new GPS (see previous post). In order to have voice output from the Zaurus I have installed FLITE,

# ipkg install flite -d loop0
# ipkg-link add flite; ipkg-link add libflite-cmu-us-kal1; ipkg-link add libflite1
Install a higher quality voice,
# ipkg install libflite-cmu-us-kal16-1 -d loop0
# ipkg-link add libflite-cmu-us-kal16-1
To replace the new voice with the old one replace the following symlink (in the /usr/lib directory),
# mv libflite_cmu_us_kal.so.1 libflite_cmu_us_kal.so.1.lowfreq
# ln libflite_cmu_us_kal16.so.1 libflite_cmu_us_kal.so.1 -s
To test flite simply run,
# flite -t "Hello world"
While we are at it, opie-reader can be setup to read text using flite. First install the opie-reader flite plugin,
# ipkg install opie-reader-output-flitecmd -d loop0
# ipkg-link add opie-reader-output-flitecmd
Now, in opie-reader under "Settings", select the "Scroll" tab. Under "Scroll type" select "Send to output" and under "Output" select "flitecmd". To start reading just start scrolling (Navagation->Scroll).
A word of warning; a. It takes couple of seconds before output starts, and b. The speech cannot be interrupted (as far as I found), opie-reader sends a full paragraph to flite, if you want to stop it - stop the scroll ONCE and wait... (I highly recommend putting a button in the toolbar)

No comments:

Post a Comment