00001 00002 // Name: tts_cepstral.h 00003 // Purpose: A wxWidgets wrapper around Cepstral voices (swift) 00004 // Author: Julian Smart 00005 // Modified by: 00006 // Created: 2009-02-10 00007 // RCS-ID: 00008 // Copyright: (c) Julian Smart 00009 // Licence: New BSD License 00011 00012 #ifndef _WX_TTS_CEPSTRAL_ 00013 #define _WX_TTS_CEPSTRAL_ 00014 00015 /* 00016 * Includes 00017 */ 00018 00019 #include "tts/tts_process.h" 00020 00021 /* 00022 * Styles and types 00023 */ 00024 00031 class wxTTSCepstralHandler: public wxTTSExternalCommandHandler 00032 { 00033 DECLARE_DYNAMIC_CLASS( wxTTSCepstralHandler ) 00034 00035 public: 00036 // Constructors 00037 00038 wxTTSCepstralHandler(); 00039 ~wxTTSCepstralHandler(); 00040 00041 // Operations 00042 00044 void Init(); 00045 00047 virtual bool Initialize() { return true; } 00048 00050 virtual bool Uninitialize() { return true; } 00051 00053 virtual bool Speak(const wxString& text, int options = wxTTS_SPEAK_ASYNC); 00054 00056 virtual bool SpeakFile(const wxString& filename, int options = wxTTS_SPEAK_ASYNC, const wxString& waveFilename = wxEmptyString); 00057 00059 virtual bool DoSpeak(const wxString& textOrFilename, bool isFilename, int options = wxTTS_SPEAK_ASYNC, const wxString& waveFilename = wxEmptyString); 00060 00062 virtual bool IsSpeaking() const { return (GetProcess() != NULL); } 00063 00065 virtual wxArrayString GetAvailableVoices() const; 00066 00068 virtual wxArrayString GetAvailableVoiceVariants() const; 00069 00071 virtual bool HasCapability(wxTTSCapability capability) const; 00072 00073 virtual int GetMinSpeed() const { return 80; } 00074 virtual int GetMaxSpeed() const { return 390; } 00075 virtual int GetMinVolume() const { return 0; } 00076 virtual int GetMaxVolume() const { return 100; } 00077 00078 // Native pitch control is a multiplication factor, 00079 // but convert to percentage for wxTextToSpeech. 00080 // 50 would be the default. 00081 virtual int GetMinPitch() const { return 0; } 00082 virtual int GetMaxPitch() const { return 100; } 00083 00085 virtual wxString GetDefaultVoice() const; 00086 00088 virtual wxString GetDefaultVoiceVariant() const; 00089 00091 static wxArrayString GetAvailableVoicesForDir(const wxString& voicesDir); 00092 00093 protected: 00094 }; 00095 00096 #endif 00097 // _WX_TTS_CEPSTRAL_