<html>
  <head>
    <meta content="text/html; charset=ISO-8859-15"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <pre wrap="">Hi all,


I worked a bit on Navit config file for QTMoko, I though this may
be helful for some users. I was a bit bored of the poor sound
quality at the start of each announcement due to the sound card waking
up just as the speech starts. So I tried to include a sound file before
each announcement to give enough time for the card to prepare before the
speech (as explained here <a class="moz-txt-link-rfc2396E" href="http://wiki.navit-project.org/index.php/Speech"><http://wiki.navit-project.org/index.php/Speech></a>).
However this was not exactly useful because each sound file was
suffering from the exact same problem, so the speech was still degraded.
Therefore I decided to merge the two wav files into a third one so that
the sound would not be interrupted as the two are being played. Here are
the steps I followed (let me know if you have a better way to do it).
First of all I installed sox and its dependancies:

apt-get install sox

then I changed the config file ~/.Navit/navit.xml to redirect speech
commands into an external file at line 742 (I got this from the Navit
website):

<speech type="cmdline" data="/media/card/Navit/speech.sh %s" cps="10" />

I created the folder /media/card/Navit that contains the file Sound.wav
(whatever you like as long as it is mono and 22050 Hz sample rate, I
used a 1.5s bleep-ish sound) and the script speech.sh that follows:

#!<i class="moz-txt-slash"><span class="moz-txt-tag">/</span>bin/bash<span class="moz-txt-tag">/</span></i>
espeak -ven-uk+m1 -s 140 -a 100 -p 50 "$1" -w ./speech.wav
sox -r 22050 -e signed-integer -b 16 -v 1.5 ./Sound.wav ./tmp1.raw
sox -r 22050 -e signed-integer -b 16 ./speech.wav ./tmp2.raw
cat ./tmp1.raw ./tmp2.raw > ./tmp3.raw
sox -r 22050 -e signed-integer -b 16 ./tmp3.raw -r 22050 -e
signed-integer -b 16 ./playing.wav
aplay -r 22050 ./playing.wav

make it executable:

chmod +x /media/card/Navit/speech.sh

Then you can try the result by typing something like:

/media/card/Navit/speech.sh 'this is a test'

the result is quite nice, the sound is a bit scratchy at the beginning
of the sound file due to the wake up problem but the speech is now
completely clear.

All the best,</pre>
  </body>
</html>