diff options
-rw-r--r-- | rbutil/rbutilqt/base/ttsbase.cpp | 34 | ||||
-rw-r--r-- | rbutil/rbutilqt/base/ttssapi4.h | 44 | ||||
-rw-r--r-- | rbutil/rbutilqt/rbutilqt.pri | 1 |
3 files changed, 59 insertions, 20 deletions
diff --git a/rbutil/rbutilqt/base/ttsbase.cpp b/rbutil/rbutilqt/base/ttsbase.cpp index 9cc12fb586..5955f825b4 100644 --- a/rbutil/rbutilqt/base/ttsbase.cpp +++ b/rbutil/rbutilqt/base/ttsbase.cpp | |||
@@ -20,6 +20,7 @@ | |||
20 | 20 | ||
21 | #include "ttsfestival.h" | 21 | #include "ttsfestival.h" |
22 | #include "ttssapi.h" | 22 | #include "ttssapi.h" |
23 | #include "ttssapi4.h" | ||
23 | #include "ttsexes.h" | 24 | #include "ttsexes.h" |
24 | #if defined(Q_OS_MACX) | 25 | #if defined(Q_OS_MACX) |
25 | #include "ttscarbon.h" | 26 | #include "ttscarbon.h" |
@@ -42,7 +43,10 @@ void TTSBase::initTTSList() | |||
42 | ttsList["flite"] = tr("Flite TTS Engine"); | 43 | ttsList["flite"] = tr("Flite TTS Engine"); |
43 | ttsList["swift"] = tr("Swift TTS Engine"); | 44 | ttsList["swift"] = tr("Swift TTS Engine"); |
44 | #if defined(Q_OS_WIN) | 45 | #if defined(Q_OS_WIN) |
45 | ttsList["sapi"] = tr("SAPI TTS Engine"); | 46 | #if 0 /* SAPI4 has been disabled since long. Keep support for now. */ |
47 | ttsList["sapi4"] = tr("SAPI4 TTS Engine"); | ||
48 | #endif | ||
49 | ttsList["sapi"] = tr("SAPI5 TTS Engine"); | ||
46 | #endif | 50 | #endif |
47 | #if defined(Q_OS_LINUX) | 51 | #if defined(Q_OS_LINUX) |
48 | ttsList["festival"] = tr("Festival TTS Engine"); | 52 | ttsList["festival"] = tr("Festival TTS Engine"); |
@@ -56,36 +60,26 @@ void TTSBase::initTTSList() | |||
56 | TTSBase* TTSBase::getTTS(QObject* parent,QString ttsName) | 60 | TTSBase* TTSBase::getTTS(QObject* parent,QString ttsName) |
57 | { | 61 | { |
58 | 62 | ||
59 | TTSBase* tts; | 63 | TTSBase* tts = 0; |
60 | #if defined(Q_OS_WIN) | 64 | #if defined(Q_OS_WIN) |
61 | if(ttsName == "sapi") | 65 | if(ttsName == "sapi") |
62 | { | ||
63 | tts = new TTSSapi(parent); | 66 | tts = new TTSSapi(parent); |
64 | return tts; | 67 | else if (ttsName == "sapi4") |
65 | } | 68 | tts = new TTSSapi4(parent); |
66 | else | 69 | else |
67 | #endif | 70 | #elif defined(Q_OS_LINUX) |
68 | #if defined(Q_OS_LINUX) | ||
69 | if (ttsName == "festival") | 71 | if (ttsName == "festival") |
70 | { | ||
71 | tts = new TTSFestival(parent); | 72 | tts = new TTSFestival(parent); |
72 | return tts; | ||
73 | } | ||
74 | else | 73 | else |
75 | #endif | 74 | #elif defined(Q_OS_MACX) |
76 | #if defined(Q_OS_MACX) | ||
77 | if(ttsName == "carbon") | 75 | if(ttsName == "carbon") |
78 | { | ||
79 | tts = new TTSCarbon(parent); | 76 | tts = new TTSCarbon(parent); |
80 | return tts; | ||
81 | } | ||
82 | else | 77 | else |
83 | #endif | 78 | #endif |
84 | if (true) // fix for OS other than WIN or LINUX | 79 | // fix for OS other than WIN or LINUX |
85 | { | 80 | if (true) |
86 | tts = new TTSExes(ttsName,parent); | 81 | tts = new TTSExes(ttsName, parent); |
87 | return tts; | 82 | return tts; |
88 | } | ||
89 | } | 83 | } |
90 | 84 | ||
91 | // get the list of encoders, nice names | 85 | // get the list of encoders, nice names |
diff --git a/rbutil/rbutilqt/base/ttssapi4.h b/rbutil/rbutilqt/base/ttssapi4.h new file mode 100644 index 0000000000..bcfb036107 --- /dev/null +++ b/rbutil/rbutilqt/base/ttssapi4.h | |||
@@ -0,0 +1,44 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * | ||
9 | * Copyright (C) 2012 by Dominik Riebeling | ||
10 | * | ||
11 | * This program is free software; you can redistribute it and/or | ||
12 | * modify it under the terms of the GNU General Public License | ||
13 | * as published by the Free Software Foundation; either version 2 | ||
14 | * of the License, or (at your option) any later version. | ||
15 | * | ||
16 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
17 | * KIND, either express or implied. | ||
18 | * | ||
19 | ****************************************************************************/ | ||
20 | |||
21 | #ifndef TTSSAPI4_H | ||
22 | #define TTSSAPI4_H | ||
23 | |||
24 | #include "ttsbase.h" | ||
25 | #include "ttssapi.h" | ||
26 | |||
27 | class TTSSapi4: public TTSSapi | ||
28 | { | ||
29 | //! Enum to identify the settings | ||
30 | Q_OBJECT | ||
31 | public: | ||
32 | TTSSapi4(QObject* parent=NULL) | ||
33 | { | ||
34 | m_TTSTemplate = "cscript //nologo \"%exe\" " | ||
35 | "/language:%lang /voice:\"%voice\" " | ||
36 | "/speed:%speed \"%options\" /sapi4"; | ||
37 | m_TTSVoiceTemplate = "cscript //nologo \"%exe\" " | ||
38 | "/language:%lang /listvoices /sapi4"; | ||
39 | m_TTSType = "sapi4"; | ||
40 | } | ||
41 | |||
42 | }; | ||
43 | |||
44 | #endif | ||
diff --git a/rbutil/rbutilqt/rbutilqt.pri b/rbutil/rbutilqt/rbutilqt.pri index 141c5eea75..b6aac3bb43 100644 --- a/rbutil/rbutilqt/rbutilqt.pri +++ b/rbutil/rbutilqt/rbutilqt.pri | |||
@@ -113,6 +113,7 @@ HEADERS += \ | |||
113 | base/ttsexes.h \ | 113 | base/ttsexes.h \ |
114 | base/ttsfestival.h \ | 114 | base/ttsfestival.h \ |
115 | base/ttssapi.h \ | 115 | base/ttssapi.h \ |
116 | base/ttssapi4.h \ | ||
116 | ../../tools/wavtrim.h \ | 117 | ../../tools/wavtrim.h \ |
117 | ../../tools/voicefont.h \ | 118 | ../../tools/voicefont.h \ |
118 | base/voicefile.h \ | 119 | base/voicefile.h \ |