diff options
author | Thorvald Natvig <slicer@users.sourceforge.net> | 2007-12-11 22:20:44 +0300 |
---|---|---|
committer | Thorvald Natvig <slicer@users.sourceforge.net> | 2007-12-11 22:20:44 +0300 |
commit | 2ba1d598a509b55e91290b9bc5d2e409b3167dbc (patch) | |
tree | 2bab1d442b1533cfa892c714a2b2aaa6842f1f12 /src | |
parent | a8579e1a6f1e55c4d93cbd0dae2b1b8012609204 (diff) |
Support espeak, add festival suggestion for ubuntu
git-svn-id: https://mumble.svn.sourceforge.net/svnroot/mumble/trunk@898 05730e5d-ab1b-0410-a4ac-84af385074fa
Diffstat (limited to 'src')
-rw-r--r-- | src/mumble/Settings.cpp | 11 | ||||
-rw-r--r-- | src/mumble/Settings.h | 2 | ||||
-rw-r--r-- | src/mumble/TextToSpeech_unix.cpp | 4 |
3 files changed, 15 insertions, 2 deletions
diff --git a/src/mumble/Settings.cpp b/src/mumble/Settings.cpp index b3936c3c4..e24abe01a 100644 --- a/src/mumble/Settings.cpp +++ b/src/mumble/Settings.cpp @@ -71,7 +71,16 @@ Settings::Settings() { iDXOutputDelay = 5; +#ifdef TTS_ESPEAK + qsFestival=QLatin1String("/usr/bin/espeak"); + qsFestivalPattern=QLatin1String("%1\n"); +#else qsFestival=QLatin1String("/usr/bin/festival --batch --pipe"); + qsFestivalPattern=QLatin1String("(SayText \"%1\")"); + qsFestivalSearch=QLatin1String("\""); + qsFestivalReplace=QLatin1String("\\\""); +#endif + qsALSAInput=QLatin1String("default"); qsALSAOutput=QLatin1String("default"); @@ -166,6 +175,7 @@ void Settings::load() { SAVELOAD(qbaDXOutput, "directsound/output"); SAVELOAD(qsFestival, "tts/festival"); + SAVELOAD(qsFestivalPattern, "tts/pattern"); SAVELOAD(bTTS, "tts/enable"); SAVELOAD(iTTSVolume, "tts/volume"); SAVELOAD(iTTSThreshold, "tts/threshold"); @@ -273,6 +283,7 @@ void Settings::save() { SAVELOAD(qbaDXOutput, "directsound/output"); SAVELOAD(qsFestival, "tts/festival"); + SAVELOAD(qsFestivalPattern, "tts/pattern"); SAVELOAD(bTTS, "tts/enable"); SAVELOAD(iTTSVolume, "tts/volume"); SAVELOAD(iTTSThreshold, "tts/threshold"); diff --git a/src/mumble/Settings.h b/src/mumble/Settings.h index 8f41eb1ec..cbd6a87b1 100644 --- a/src/mumble/Settings.h +++ b/src/mumble/Settings.h @@ -68,7 +68,7 @@ struct Settings { int iDXOutputDelay; - QString qsFestival; + QString qsFestival, qsFestivalPattern, qsFestivalSearch, qsFestivalReplace; QString qsALSAInput, qsALSAOutput; QString qsPulseAudioInput, qsPulseAudioOutput; bool bPulseAudioEcho; diff --git a/src/mumble/TextToSpeech_unix.cpp b/src/mumble/TextToSpeech_unix.cpp index 3dac82267..3afb7ab52 100644 --- a/src/mumble/TextToSpeech_unix.cpp +++ b/src/mumble/TextToSpeech_unix.cpp @@ -53,7 +53,9 @@ TextToSpeechPrivate::~TextToSpeechPrivate() { void TextToSpeechPrivate::say(const QString &txt) { QString text = txt; - qpFestival.write(QString::fromLatin1("(SayText \"%1\")").arg(text.replace(QLatin1String("\""),QLatin1String("\\\""))).toLatin1()); + if (! g.s.qsFestivalSearch.isEmpty()) + text.replace(QRegExp(g.s.qsFestivalSearch),g.s.qsFestivalReplace); + qpFestival.write(g.s.qsFestivalPattern.arg(text).toUtf8()); } void TextToSpeechPrivate::setVolume(int) { |