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 #ifndef ARSPEECH_H
00029 #define ARSPEECH_H
00030
00031 #include "ariaTypedefs.h"
00032 #include "ArFunctor.h"
00033
00046 class ArSpeechSynth
00047 {
00048 public:
00049
00051 AREXPORT ArSpeechSynth();
00052
00053 AREXPORT virtual ~ArSpeechSynth();
00054
00055
00059 AREXPORT virtual bool init(void) = 0;
00060
00061
00071 AREXPORT virtual bool speak(const char *str, const char* voiceParams, ArRetFunctor2<bool, ArTypes::Byte2*, int>* audioOutputCB, unsigned short sampleRate = 0) = 0;
00072 AREXPORT virtual bool speak(const char *str, const char* voiceParams = NULL);
00073
00077 AREXPORT virtual bool speakf(const char* fmt, ...) = 0;
00078
00081 AREXPORT virtual void interrupt() = 0;
00082
00084 AREXPORT ArRetFunctorC<bool, ArSpeechSynth>* getInitCallback();
00085
00087 AREXPORT ArRetFunctor2C<bool, ArSpeechSynth, const char*, const char*>* getSpeakCallback(void) ;
00088
00089
00091 AREXPORT ArFunctorC<ArSpeechSynth>* getInterruptCallback();
00092
00093
00101 AREXPORT void setAudioCallback(ArRetFunctor2<bool, ArTypes::Byte2*, int>* cb);
00102
00103
00107 AREXPORT virtual void setAudioSampleRate(int rate) = 0;
00108
00109 AREXPORT virtual int getAudioSampleRate() = 0;
00110
00112 AREXPORT virtual void lock() { }
00114 AREXPORT virtual void unlock() { }
00115
00116 protected:
00117 ArRetFunctor2C<bool, ArSpeechSynth, const char*, const char*> mySpeakCB;
00118 ArRetFunctorC<bool, ArSpeechSynth> myInitCB;
00119 ArFunctorC<ArSpeechSynth> myInterruptCB;
00120 ArRetFunctor2<bool, ArTypes::Byte2*, int>* myAudioPlaybackCB;
00121
00122
00123 };
00124
00125
00126
00127 #endif