PTLib  Version 2.18.8
 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 
27 #ifndef PTLIB_PTTS_H
28 #define PTLIB_PTTS_H
29 
30 #ifdef P_USE_PRAGMA
31 #pragma interface
32 #endif
33 
34 #include <ptlib.h>
35 
36 #if P_TTS
37 
38 #include <ptlib/pfactory.h>
39 
40 
41 class PTextToSpeech : public PObject
42 {
43  PCLASSINFO(PTextToSpeech, PObject);
44  public:
45  enum TextType {
46  Default,
47  Literal,
48  Digits,
49  Number,
50  Currency,
51  Time,
52  Date,
53  DateAndTime,
54  Phone,
55  IPAddress,
56  Duration,
57  Spell
58  };
59 
60  virtual PStringArray GetVoiceList() = 0;
61  virtual PBoolean SetVoice(const PString & voice) = 0;
62 
63  virtual PBoolean SetSampleRate(unsigned rate) = 0;
64  virtual unsigned GetSampleRate() = 0;
65 
66  virtual PBoolean SetChannels(unsigned channels) = 0;
67  virtual unsigned GetChannels() = 0;
68 
69  virtual PBoolean SetVolume(unsigned volume) = 0;
70  virtual unsigned GetVolume() = 0;
71 
72  virtual PBoolean OpenFile(const PFilePath & fn) = 0;
73  virtual PBoolean OpenChannel(PChannel * chanel) = 0;
74  virtual PBoolean IsOpen() = 0;
75 
76  virtual PBoolean Close() = 0;
77  virtual PBoolean Speak(const PString & text, TextType hint = Default) = 0;
78 };
79 
80 #if P_SAPI
81  PFACTORY_LOAD(PTextToSpeech_SAPI);
82 #endif
83 
84 #if P_FESTIVAL
85  PFACTORY_LOAD(PTextToSpeech_Festival);
86 #endif
87 
88 
89 #endif // P_TTS
90 
91 #endif // PTLIB_PTTS_H
92 
93 
94 // End Of File ///////////////////////////////////////////////////////////////
#define PCLASSINFO(cls, par)
Declare all the standard PTLib class information.
Definition: object.h:2164
This class describes a full description for a file on the particular platform.
Definition: filepath.h:61
This is an array collection class of PString objects.
Definition: pstring.h:2365
#define PFACTORY_LOAD(ConcreteType)
Definition: pfactory.h:557
Abstract class defining I/O channel semantics.
Definition: channel.h:103
bool PBoolean
Definition: object.h:174
The character string class.
Definition: pstring.h:108
Ultimate parent class for all objects in the class library.
Definition: object.h:2204