PTLib  Version 2.10.4
ptts.h
Go to the documentation of this file.
00001 /*
00002  * ptts.h
00003  *
00004  * Text To Speech classes
00005  *
00006  * Portable Windows Library
00007  *
00008  * Copyright (c) 2002 Equivalence Pty. Ltd.
00009  *
00010  * The contents of this file are subject to the Mozilla Public License
00011  * Version 1.0 (the "License"); you may not use this file except in
00012  * compliance with the License. You may obtain a copy of the License at
00013  * http://www.mozilla.org/MPL/
00014  *
00015  * Software distributed under the License is distributed on an "AS IS"
00016  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
00017  * the License for the specific language governing rights and limitations
00018  * under the License.
00019  *
00020  * The Original Code is Portable Windows Library.
00021  *
00022  * The Initial Developer of the Original Code is Equivalence Pty. Ltd.
00023  *
00024  * Contributor(s): ______________________________________.
00025  *
00026  * $Revision: 25072 $
00027  * $Author: rjongbloed $
00028  * $Date: 2011-01-18 14:42:32 -0600 (Tue, 18 Jan 2011) $
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 // End Of File ///////////////////////////////////////////////////////////////
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines