From Navit's Wiki
Revision as of 09:05, 23 May 2011 by Tryagain (talk | contribs) (Reflected speech-cmdline interface changes)
Jump to: navigation, search

Using the web-based tool

We are currently using Launchpad : If you want to update a translation, or add a new one, please try using launchpad. Translations are usually updated once a week.

Configuring Speech in your language

To test results and for normal operation you should configure a speech program in navit.xml to listen the sentences, for example in spanish you could substitute the default speech definition:

<speech type="cmdline" data="echo 'Fix the speech tag in navit.xml to let navit say:' '%s'" />

with an appropiate one, that uses festival:

<speech type="cmdline" data="/usr/local/bin/speech-wrapper %s spanish">

You will also need following /usr/local/bin/speech-wrapper file wich must have an executable bit set:

echo "$1" | festival --tts --language "$2"

Here's how to use espeak:

<speech type="cmdline" data="espeak -s 150 -v german %s" />

where -s is the "Speed in words per minute" (150 seems to be quite good for german) and -v specifies the language to use. Please refer to espeak to see which languages you can use on your system and which other command-line-options are useful.

The call to external speech command is asynchronus, but it will block if previous phrase is still being speaked. The GUI will freeze while espeak is speaking to you only if it's going to say a new phrase before it end with previous. If you do not want this behaviour, you can try using wrapper script like in festival smaple but with & sign at the end of last line:

<speech type="cmdline" data="/usr/local/bin/speech-wrapper %s german" />

Script /usr/local/bin/speech-wrapper would be like this (don't forget to set executable bit):

espeak -s 150 -v "$2" "$1" &

If you are running multiple programs with audio output, it is possible that /dev/dsp is locked (the default DSP for both festival and espeak). Use the following command to re-route the sound to ALSA. (To be exact, the Wave channel on the default sound card).

<speech type="cmdline" data="/usr/local/bin/speech-wrapper %s english">

And following /usr/local/bin/speech-wrapper for espeak:

espeak -s 150 -v "$2" --stdout "$1" | aplay > /dev/null

Note on the Dutch language

I had good success with the dutch extensions for festival. nextens

Especially the spoken dutch streetnames are much more clear this way.

It takes a bit of work to compile it, but i think it is worth the effort.

Letting Navit speak through KDEs kttsd in German

When you get textsynthesis in KDE running with KDEs kttsd, you can also let Navit speak through kttsd. Use this line for it (using german as language):

<speech type="cmdline" data="dcop kttsd KSpeech sayText %s de" cps="15"/>

When the kttsd is running, Navit will now speak with your configured language/voice from kttsd (run kttsmgr to configure it). Because kttsd can be made to speak german, you can let Navit now speak german, which is quite an improvement when it comes to pronouncing german words.

There is a good howto about setting kttsd up to speak german: deutsche-sprachausgabe-in-kde

Running Debian Lenny, the mbrola-packages can be installed with apt-get (or synaptic, or aptitude, ...). I have just installed all the stuff with "apt-get install kttsd kttsd-contrib-plugins kmouth ksayit mbrola mbrola-de6 mbrola-de7" and installed and configured the "txt2pho" like described in the howto and got a full functioning, german speech synthesis in KDE. Which Navit (with the <speech type="cmdline" data="dcop kttsd KSpeech sayText %s de" cps="15"/>) uses without problems.