1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
9 * Copyright (C) 2007 by Dominik Wenger
11 * All files in this archive are subject to the GNU General Public License.
12 * See the file COPYING in the source tree root for full license agreement.
14 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
15 * KIND, either express or implied.
17 ****************************************************************************/
22 #include "ttsfestival.h"
27 #include "ttsespeak.h"
30 #if defined(Q_OS_MACX)
31 #include "ttscarbon.h"
34 // list of tts names and identifiers
35 QMap
<QString
,QString
> TTSBase::ttsList
;
37 TTSBase::TTSBase(QObject
* parent
): EncTtsSettingInterface(parent
)
42 void TTSBase::initTTSList()
44 #if !defined(Q_OS_WIN)
45 ttsList
["espeak"] = tr("Espeak TTS Engine");
47 ttsList
["flite"] = tr("Flite TTS Engine");
48 ttsList
["swift"] = tr("Swift TTS Engine");
50 #if 0 /* SAPI4 has been disabled since long. Keep support for now. */
51 ttsList
["sapi4"] = tr("SAPI4 TTS Engine");
53 ttsList
["sapi"] = tr("SAPI5 TTS Engine");
54 ttsList
["mssp"] = tr("MS Speech Platform");
56 #if defined(Q_OS_LINUX)
57 ttsList
["festival"] = tr("Festival TTS Engine");
59 #if defined(Q_OS_MACX)
60 ttsList
["carbon"] = tr("OS X System Engine");
64 // function to get a specific encoder
65 TTSBase
* TTSBase::getTTS(QObject
* parent
,QString ttsName
)
71 tts
= new TTSSapi(parent
);
72 else if (ttsName
== "sapi4")
73 tts
= new TTSSapi4(parent
);
74 else if (ttsName
== "mssp")
75 tts
= new TTSMssp(parent
);
77 #elif defined(Q_OS_LINUX)
78 if (ttsName
== "festival")
79 tts
= new TTSFestival(parent
);
81 #elif defined(Q_OS_MACX)
82 if(ttsName
== "carbon")
83 tts
= new TTSCarbon(parent
);
86 if(ttsName
== "espeak")
87 tts
= new TTSEspeak(parent
);
88 else if(ttsName
== "flite")
89 tts
= new TTSFlite(parent
);
90 else if(ttsName
== "swift")
91 tts
= new TTSSwift(parent
);
92 else if(ttsName
== "user")
93 tts
= new TTSExes(parent
);
98 // get the list of encoders, nice names
99 QStringList
TTSBase::getTTSList()
101 // init list if its empty
102 if(ttsList
.count() == 0)
105 return ttsList
.keys();
108 // get nice name of a specific tts
109 QString
TTSBase::getTTSName(QString tts
)
111 if(ttsList
.isEmpty())
113 return ttsList
.value(tts
);