summaryrefslogtreecommitdiff
path: root/rbutil/rbutilqt/base/ttscarbon.h
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2010-02-28 20:19:54 +0000
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2010-02-28 20:19:54 +0000
commit495edfb7b95994ed44a5ebb4ef1fca716d1254d4 (patch)
tree795cc85d9979a3545b270c747c19601d84ac3b3d /rbutil/rbutilqt/base/ttscarbon.h
parentc1689ca80d3f43ca079062864fe0d9c2c32ff99b (diff)
downloadrockbox-495edfb7b95994ed44a5ebb4ef1fca716d1254d4.tar.gz
rockbox-495edfb7b95994ed44a5ebb4ef1fca716d1254d4.zip
Add support for OS X' Speech Synthesis Manager TTS system.
This adds basic support for using the OS X' TTS system. The current implementation does only support selecting the voice itself, no further settings (like speed pitch / speed) adjustments are implemented. As OS X' TTS system wants the strings to get spoken in 8 bit encoding problems with locale combinations are possible. For this better error handling in the rbutil TTS is needed. The voice test button in the configuration dialog reacts pretty slow due to the way its speaking is done. This can get changed but also requires adjustments in the rbutil TTS system. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24979 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'rbutil/rbutilqt/base/ttscarbon.h')
-rw-r--r--rbutil/rbutilqt/base/ttscarbon.h72
1 files changed, 72 insertions, 0 deletions
diff --git a/rbutil/rbutilqt/base/ttscarbon.h b/rbutil/rbutilqt/base/ttscarbon.h
new file mode 100644
index 0000000000..c6b4a61320
--- /dev/null
+++ b/rbutil/rbutilqt/base/ttscarbon.h
@@ -0,0 +1,72 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 *
9 * Copyright (C) 2010 by Dominik Riebeling
10 * $Id$
11 *
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
14 *
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
17 *
18 ****************************************************************************/
19
20#ifndef TTSCARBON_H
21#define TTSCARBON_H
22
23#include <QtCore>
24#include "ttsbase.h"
25
26#include <Carbon/Carbon.h>
27#include <inttypes.h>
28
29class TTSCarbon : public TTSBase
30{
31 Q_OBJECT
32 //! Enum to identify the settings
33 enum ConfigValuesCarbon
34 {
35 ConfigVoice
36 };
37 public:
38 TTSCarbon(QObject *parent = NULL);
39
40 //! Child class should generate a clip
41 TTSStatus voice(QString text,QString wavfile, QString* errStr);
42 //! Child class should do startup
43 bool start(QString *errStr);
44 //! child class should stop
45 bool stop() ;
46
47 // configuration
48 //! Child class should return true, when configuration is good
49 bool configOk();
50 //! Child class should generate and insertSetting(..) its settings
51 void generateSettings();
52 //! Chlid class should commit the Settings to permanent storage
53 void saveSettings();
54
55 private:
56 SpeechChannel m_channel;
57 CFStringBuiltInEncodings m_voiceScript;
58
59 unsigned long be2u32(unsigned char* buf);
60 unsigned long be2u16(unsigned char* buf);
61 unsigned char* u32tobuf(unsigned char* buf, uint32_t val);
62 unsigned char* u16tobuf(unsigned char* buf, uint16_t val);
63 unsigned int extended2int(unsigned char* buf);
64 int convertAiffToWav(const char* aiff, const char* wav);
65
66
67 protected:
68 // static QMap<QString,QString> ttsList;
69};
70
71#endif // TTSCARBON_H
72