#include <ArSpeech.h>
Public Member Functions | |
ArSpeechSynth () | |
ArRetFunctorC< bool, ArSpeechSynth > * | getInitCallback () |
ArFunctorC< ArSpeechSynth > * | getInterruptCallback () |
ArRetFunctor2C< bool, ArSpeechSynth, const char *, const char * > * | getSpeakCallback (void) |
virtual bool | init (void)=0 |
virtual void | interrupt ()=0 |
void | setAudioCallback (ArRetFunctor2< bool, ArTypes::Byte2 *, int > *cb) |
virtual void | setAudioSampleRate (int rate)=0 |
virtual bool | speak (const char *str, const char *params=0)=0 |
virtual bool | speakf (const char *fmt,...)=0 |
Protected Attributes | |
ArRetFunctor2< bool, ArTypes::Byte2 *, int > * | myAudioPlaybackCB |
If set, send audio to this callback instead of playing it directly. | |
ArRetFunctorC< bool, ArSpeechSynth > | myInitCB |
ArFunctorC< ArSpeechSynth > | myInterruptCB |
ArRetFunctor2C< bool, ArSpeechSynth, const char *, const char * > | mySpeakCB |
This class defines the abstract interface for speech synthesers used with Aria. Implementations are provided in the seperate ArSpeechSynth_Cepstral and ArSpeechSynth_Festival libraries, and ArCepstral and ArFestival classes respectively. When one of these libraries is loaded at program run time (or if they are statically linked), it will set the factory callback used by newDefaultSpeechSynthesizer(). This class provides a common-denominator interface. Implementations (especially ArCepstral) may support more features, or behave differently refer to their documentation for more information.
Definition at line 48 of file ArSpeech.h.
|
Don't forget to call this from derived classes. Definition at line 32 of file ArSpeech.cpp. |
|
Definition at line 44 of file ArSpeech.cpp. |
|
Definition at line 55 of file ArSpeech.cpp. |
|
Definition at line 49 of file ArSpeech.cpp. |
|
Perform synthesizer initialization, if neccesary. You must call this method. |
|
If any speech is currently ongoing, interrupt it. |
|
Instead of playing synthesized audio using the synthesizer's internal audio playback, call the given callback when a chunk of audio has been synthesized. Audio is passed to the callback in the first parameter as signed 16-bit samples (PCM16). The sample rate is 16kHz but may be changed with setAudioSampleRate(). The second parameter is the number of samples. The return value from the callback is ignored. Definition at line 60 of file ArSpeech.cpp. References myAudioPlaybackCB. |
|
Change audio sample rate (Hz). Normal rate is 16000 Hz. Suggested values are 8000, 16000, or 44400 |
|
Speak the given text.
|
|
Speaks the given string, taking varargs and a format string (like printf) |