# nanotts output module is based on the generic plugin for Speech
# Dispatcher. It means there is no code written explicitly for
# this plugin, all the specifics are handled in this configuration
# and we call a simple command line client to perform the actual
# synthesis. Use this config file with the sd_generic output module.
#
# IMPORTANT: The audio output method relies on an audio playback
# utility (play, aplay, paplay for OSS, ALSA or Pulse)
# being installed. If this is not the case, consider installing it
# or replace the $PLAY_COMMAND string in the GenericExecuteString below
# with play, paplay or similar.
#
# GenericExecuteSynth is the shell command that should be
# executed in order to say some message. This command must
# stop saying the message on SIGKILL, otherwise it's useless.
# You can use the variables $LANGUAGE, $VOICE, $PITCH and $RATE
# which will be substituted for the appropriate value (you
# can modify this value, see other parameters).
# The command can be split into more lines, if necessary, using '\'.
GenericExecuteSynth \
"nanotts-git -v $VOICE --speed $RATE --pitch $PITCH --volume $VOLUME -w \'$DATA\' -c -m | play -q -t raw -r 16000 -e s -b 16 -"

# The following three items control punctuation levels None, Some, and All.
# Each of these values will be substituted into the $PUNCT variable depending
# on the value passed to speech dispatcher from applications.
# Note that if an empty string is specified, then $PUNCT will be blank 
# which is a default situation for espeak.
 
GenericPunctNone " "
GenericPunctSome "--punct=\"()[]{};:\""
GenericPunctAll "--punct"

# GenericStripPunctChars is a list (enclosed in doublequotes) of
# all the characters that should be replaced by whitespaces in
# order not to be badly handled by the output module or misinterpreted
# by shell.
# GenericStripPunctChars  ""

# If the language you need to pass in $LANG is different
# from the standard ISO language code, you can specify
# which string to use instead. If you wish to use
# other than ISO charset for the specified language,
# you can add it's name (as accepted by iconv) as a
# third parameter in doublequotes.


GenericLanguage		  "en" "en" "utf-8"
GenericLanguage		  "de" "de" "utf-8"
GenericLanguage		  "es" "es" "utf-8"
GenericLanguage		  "fr" "fr" "utf-8"
GenericLanguage		  "it" "it" "utf-8"

# AddVoice specifies which $VOICE string should be assigned to
# each language and symbolic voice name. All the voices you want
# to use must be specified here. This list will likely not be
# up-to-date, please check nanotts documentation and add the voices
# you want to use.

AddVoice        "en"    "FEMALE1"	"en-US"
AddVoice        "en"    "FEMALE2"	"en-GB"
AddVoice        "en-us"    "FEMALE1"	"en-US"
AddVoice        "de"    "FEMALE1"	"de-DE"
AddVoice        "es"    "FEMALE1"	"es-ES"
AddVoice        "fr"    "FEMALE1"	"fr-FR"
AddVoice        "it"    "FEMALE1"	"it-IT"

# Yes, it's wrong, but this way you at least get something even when configured
# (by default) to use a male voice
AddVoice        "en"    "MALE1"		"en-US"
AddVoice        "en"    "MALE2"		"en-GB"
AddVoice        "en-us"    "MALE1"		"en-US"
AddVoice        "de"    "MALE1"		"de-DE"
AddVoice        "es"    "MALE1"		"es-ES"
AddVoice        "fr"    "MALE1"		"fr-FR"
AddVoice        "it"    "MALE1"		"it-IT"

# These parameters set _rate_, _pitch_, and _volume_ conversion. This is
# part of the core of the definition of this generic output
# module for this concrete synthesizer, it's not intended to
# be modified by common users.
# The resulting rate (or pitch) has the form:
#       (speechd_rate * GenericRateMultiply) + GenericRateAdd
# while speechd_rate is a value between -100 (lowest) and +100 (highest)
# You have to define some meaningful conversion for each synthesizer

# Here's the mapping from SSIP (Speech Dispatcher) to ESpeak (v1.10):
#
#           SSIP Range  SSIP Default    ESpeak/MBROLA Range ESpeak Default
#           ----------- ------------    ------------         --------------
# Rate      -100 to 100     0           80 to 320       160
# Pitch     -100 to 100     0            0 to 99         50
# Volume    -100 to 100     0            0 to 2          --
#
# The SSIP defaults are actually controlled via DefaultRate, DefaultPitch, and
# DefaultVolume in the speechd.conf file.

GenericRateAdd          1
GenericPitchAdd         1
GenericVolumeAdd        0

# (These values are multiplied by 100, because DotConf currently
# doesn't support floats. So you can write 0.85 as 85 and so on.)

GenericRateMultiply     1
GenericPitchMultiply   1
GenericVolumeMultiply   1

# If the client program can't handle floats, you will have to
# use these two options to force integers as the parameters
# 1 means force integers, 0 means do nothing (write floats).

GenericRateForceInteger     0
GenericPitchForceInteger    0
GenericVolumeForceInteger   0

# Note that SSIP rates < -50 are spoken at -50.

# Debug turns debugging on or off
# See speechd.conf for information where debugging information is stored
Debug 0
