speech-dispatcher: Configuration of the Generic Output Module
2.4.5.3 Configuration files of the Generic Output Module
........................................................
The generic output module allows you to easily write your own output
module for synthesizers that have a simple command line interface by
modifying the configuration file. This way, users can add support for
their device even if they don't know how to program. ⇒AddModule.
The core part of a generic output module is the command execution
line.
-- Generic Module Configuration: GenericExecuteSynth "EXECUTION_STRING"
'execution_string' is the command that should be executed in a
shell when it's desired to say something. In fact, it can be
multiple commands concatenated by the '&&' operator. To stop
saying the message, the output module will send a KILL signal to
the process group, so it's important that it immediately stops
speaking after the processes are killed. (On most GNU/Linux
system, the 'play' utility has this property).
In the execution string, you can use the following variables, which
will be substituted by the desired values before executing the
command.
* '$DATA' The text data that should be said. The string's
characters that would interfere with bash processing are
already escaped. However, it may be necessary to put double
quotes around it (like this: '\"$DATA\"').
* '$LANG' The language identification string (it's defined by
GenericLanguage).
* '$VOICE' The voice identification string (it's defined by
AddVoice).
* '$PITCH' The desired pitch (a float number defined in
GenericPitchAdd and GenericPitchMultiply).
* '$PITCH_RANGE' The desired pitch range (a float number defined
in GenericPitchRangeAdd and GenericPitchRangeMultiply).
* '$RATE' The desired rate or speed (a float number defined in
GenericRateAdd and GenericRateMultiply)
Here is an example from
'etc/speech-dispatcher/modules/epos-generic.conf'
GenericExecuteSynth \
"epos-say -o --language $LANG --voice $VOICE --init_f $PITCH --init_t $RATE \
\"$DATA\" | sed -e s+unknown.*$++ >/tmp/epos-said.wav && play /tmp/epos-said.wav >/dev/null"
-- GenericModuleConfiguration: AddVoice "LANGUAGE" "SYMBOLICNAME"
"NAME"
⇒AddVoice.
-- GenericModuleConfiguration: GenericLanguage "iso-code"
"string-subst" "character-set"
Defines which string 'string-subst' should be substituted for
'$LANG' given an 'iso-code' language code. Optionally, the
character set in which the text will be passed to the module can be
specified. If unset, it will default to iso-8859-1.
Another example from Epos generic:
GenericLanguage "en-US" "english-US"
GenericLanguage "cs" "czech" "iso-8859-2"
GenericLanguage "sk" "slovak" "iso-8859-2"
-- GenericModuleConfiguration: GenericRateAdd NUM
-- GenericModuleConfiguration: GenericRateMultiply NUM
-- GenericModuleConfiguration: GenericPitchAdd NUM
-- GenericModuleConfiguration: GenericPitchMultiply NUM
-- GenericModuleConfiguration: GenericPitchRangeAdd NUM
-- GenericModuleConfiguration: GenericPitchRangeMultiply NUM
These parameters set rate and pitch conversion to compute the value
of '$RATE', '$PITCH' and '$PITCH_RANGE'.
The resulting rate (or pitch) is calculated using the following
formula:
(speechd_rate * GenericRateMultiply) + GenericRateAdd
where speechd_rate is a value between -100 (lowest) and +100
(highest) Some meaningful conversion for the specific
text-to-speech system used must by defined.
(The values in GenericSthMultiply are multiplied by 100 because
DotConf currently doesn't support floats. So you can write 0.85 as
85 and so on.)