2006-06-29

CAIVIAR capiserver using realspeak

Finally....

The caiviar server source 0.3.5 has some flaws when compiling/using it in relation to Scansoft RealSpeak TTS engine under Linux.

Currently, I can't make the thing connect to a Scansoft TTS-server, but I can use the engine statically linked in.

In what follows, I assumed (change for your needs):

  • the installation of scansoft realspeak is in REALSPEAKDIR (mine: /opt/scansoft/tts)
    REALSPEAKDIR=/opt/scansoft/tts/
  • the caiviar source is in CAIVIARDIR (mine: /tmp/caiviar-0.3.5)
    CAIVIARDIR=/tmp/caiviar-0.3.5/


this is what I did:

fix ${CAIVIARDIR}server/RealSpeak.cpp

I *did* alter more than minimally needed. Most importantly:

  • change the ".\\Engine" string you find into the directory needed for your system. (I changed it to "/opt/scansoft/tts/engine"
  • replace tts_language by language
  • replace stdup by strdup
  • if needed, change or adjust the code around "Setting language to" to have YOUR constant(s) (for your specific language).
    You should consult ${REALSPEAKDIR}api/inc/lh_ttsso.h (or your RealSpeak documentation) for correct values/constants.

    Check after installation (see below) the configuration file (probably /etc/ivr.properties the line stating realspeak.language= should have one of the strings caught by that functionality. (default is "german").


incorporate RealSpeak includes and objects (of your RealSpeak obtained installation)

cp ${REALSPEAKDIR}api/lib/* ${CAIVIARDIR}server/TTS
cp ${REALSPEAKDIR}api/inc/* ${CAIVIARDIR}server/TTS


configure and compile caiviar (capiserver)

cd ${CAIVIARDIR} && ./configure --enable_realspeak && make

install caiviar (capiserver)

cd ${CAIVIARDIR} && sudo make install

create sysv-init script:

create /etc/init.d/capiserver

#!/bin/bash
# Filename: capiserver
# Version: 1.0
# Author: Dieter Demerre
# Description
# SysV-init script to launch capiserver
#
# usually known as: /etc/init.d/capiserver
#
NAME="CAIVIAR CAPI Server"
CAIVIARCONFIG=/etc/ivr.properties
CAIVIAR_PIDFILE=/var/run/capiserver.init.pid
CAIVIAR=/usr/local/bin/capiserver
if [ ! -x ${CAIVIAR} ]; then
echo -n "\nError: Could not find ${CAIVIAR} executable.\n" >&2
exit 5
fi
test -f ${CAIVIARCONFIG} || echo "WARNING no ${CAIVIARCONFIG} config found\n" >&2
case "$1" in
start) startproc -f -p ${CAIVIAR_PIDFILE} ${CAIVIAR};;
stop) killproc -p $CAIVIAR_PIDFILE -TERM ${CAIVIAR};;
restart) $0 stop ; $0 start;;
*) echo -n "unknown action.\nknown actions are: (start|stop|restart)\n"; exit ;;
esac

link to /etc/init.d/capiserver from the expected sysV runlevel directories (distribution specific, maybe use system-tools to set the links).

for level in 2 3 5;
do
sudo ln -sf ../init.d/capiserver /etc/init.d/rc${level}.d/S99capiserver;
done


Labels: , , , , , ,

2006-04-05

Timidity++ compiling for cygwin

Timidity++
As stated in another thread, Timidity++ is a cool program to play (and convert) midi files. As I'm using it to convert midi files to .wav files (and then burn them to cd), I love to have a similar possibility under windows.

cygwin compilation
So I set out to compile Timidity++ in cygwin:
download the source from http://timidity.sourceforge.net/ and run cygwin for following:
  • tar jxf TiMidity++-2.13.0.tar.bz2
  • cd TiMidity++-2.13.0
  • bash ./configure --enable-interface=ncurses,gtk --enable-network --enable-audio=w32
  • export PATH=$PATH:. && make
  • make install
Configure TiMidity++
To run timidity correctly, you need a timidity.cfg file. Put it in %SystemRoot% (probably c:\windows). You can find one at http://home.swipnet.se/~w-10694/docs/timidity.cfg. This file makes references to directories:
dir /usr/local/lib/timidity

Now you only have to get .pat files and put them in that directory. You can get a copy of eawpats12_full.rar in http://people.fruitsalad.org/lauri/stuff/eawpats12_full.rar, unrar it to /usr/local/lib/timidity (as configured in timidity.cfg).

running timidity
It works:
timidity -int fn039russians.mid

Or if for instance you wanna convert a midi to a wav (which is what I wanted initially)
timidity --output-mode=w --output-file=result.wav fn039russians.mid

But for that look in the thread midi to wav conversion

Labels: , , ,