PTLib  Version 2.14.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ptts.h
Go to the documentation of this file.
1 /*
2  * ptts.h
3  *
4  * Text To Speech classes
5  *
6  * Portable Windows Library
7  *
8  * Copyright (c) 2002 Equivalence Pty. Ltd.
9  *
10  * The contents of this file are subject to the Mozilla Public License
11  * Version 1.0 (the "License"); you may not use this file except in
12  * compliance with the License. You may obtain a copy of the License at
13  * http://www.mozilla.org/MPL/
14  *
15  * Software distributed under the License is distributed on an "AS IS"
16  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
17  * the License for the specific language governing rights and limitations
18  * under the License.
19  *
20  * The Original Code is Portable Windows Library.
21  *
22  * The Initial Developer of the Original Code is Equivalence Pty. Ltd.
23  *
24  * Contributor(s): ______________________________________.
25  *
26  * $Revision: 29535 $
27  * $Author: rjongbloed $
28  * $Date: 2013-04-19 18:51:15 +1000 (Fri, 19 Apr 2013) $
29  */
30 
31 #ifndef PTLIB_PTTS_H
32 #define PTLIB_PTTS_H
33 
34 #ifdef P_USE_PRAGMA
35 #pragma interface
36 #endif
37 
38 #include <ptlib.h>
39 
40 #if P_TTS
41 
42 #include <ptlib/pfactory.h>
43 
44 
45 class PTextToSpeech : public PObject
46 {
47  PCLASSINFO(PTextToSpeech, PObject);
48  public:
49  enum TextType {
50  Default,
51  Literal,
52  Digits,
53  Number,
54  Currency,
55  Time,
56  Date,
57  DateAndTime,
58  Phone,
59  IPAddress,
60  Duration,
61  Spell
62  };
63 
64  virtual PStringArray GetVoiceList() = 0;
65  virtual PBoolean SetVoice(const PString & voice) = 0;
66 
67  virtual PBoolean SetRate(unsigned rate) = 0;
68  virtual unsigned GetRate() = 0;
69 
70  virtual PBoolean SetVolume(unsigned volume) = 0;
71  virtual unsigned GetVolume() = 0;
72 
73  virtual PBoolean OpenFile(const PFilePath & fn) = 0;
74  virtual PBoolean OpenChannel(PChannel * chanel) = 0;
75  virtual PBoolean IsOpen() = 0;
76 
77  virtual PBoolean Close() = 0;
78  virtual PBoolean Speak(const PString & text, TextType hint = Default) = 0;
79 };
80 
81 #if P_SAPI
82  PFACTORY_LOAD(PTextToSpeech_SAPI);
83 #endif
84 
85 #if P_PIPECHAN
86  PFACTORY_LOAD(PTextToSpeech_Festival);
87 #endif
88 
89 
90 #endif // P_TTS
91 
92 #endif // PTLIB_PTTS_H
93 
94 
95 // End Of File ///////////////////////////////////////////////////////////////