00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #ifndef PTLIB_PTTS_H
00032 #define PTLIB_PTTS_H
00033
00034 #ifdef P_USE_PRAGMA
00035 #pragma interface
00036 #endif
00037
00038 #include <ptbuildopts.h>
00039
00040 #if P_TTS
00041
00042 #include <ptlib/pfactory.h>
00043
00044
00045 class PTextToSpeech : public PObject
00046 {
00047 PCLASSINFO(PTextToSpeech, PObject);
00048 public:
00049 enum TextType {
00050 Default,
00051 Literal,
00052 Digits,
00053 Number,
00054 Currency,
00055 Time,
00056 Date,
00057 DateAndTime,
00058 Phone,
00059 IPAddress,
00060 Duration,
00061 Spell
00062 };
00063
00064 virtual PStringArray GetVoiceList() = 0;
00065 virtual PBoolean SetVoice(const PString & voice) = 0;
00066
00067 virtual PBoolean SetRate(unsigned rate) = 0;
00068 virtual unsigned GetRate() = 0;
00069
00070 virtual PBoolean SetVolume(unsigned volume) = 0;
00071 virtual unsigned GetVolume() = 0;
00072
00073 virtual PBoolean OpenFile(const PFilePath & fn) = 0;
00074 virtual PBoolean OpenChannel(PChannel * chanel) = 0;
00075 virtual PBoolean IsOpen() = 0;
00076
00077 virtual PBoolean Close() = 0;
00078 virtual PBoolean Speak(const PString & text, TextType hint = Default) = 0;
00079 };
00080
00081 #if P_SAPI
00082 PFACTORY_LOAD(PTextToSpeech_SAPI);
00083 #endif
00084
00085 #ifndef _WIN32_WCE
00086 PFACTORY_LOAD(PTextToSpeech_Festival);
00087 #endif
00088
00089
00090 #endif // P_TTS
00091
00092 #endif // PTLIB_PTTS_H
00093
00094
00095