wxTTSHandler Class Reference

A base class for implementing a driver for a particular speech engine. More...

#include <tts/tts.h>

Inheritance diagram for wxTTSHandler:

wxTTSExternalCommandHandler wxTTSMacOSXHandler wxTTSSapiHandler wxTTSCepstralHandler wxTTSEspeakHandler List of all members.

Public Member Functions

 wxTTSHandler (const wxString &id=wxEmptyString, const wxString &displayName=wxEmptyString)
 ~wxTTSHandler ()
virtual bool Initialize ()
 Initialize the engine. Can call multiple times.
virtual bool Uninitialize ()
 Clean up the engine. Can call multiple times.
virtual bool Speak (const wxString &text, int options=wxTTS_SPEAK_ASYNC)=0
 Speak the text.
virtual bool SpeakFile (const wxString &filename, int options=wxTTS_SPEAK_ASYNC, const wxString &waveFilename=wxEmptyString)=0
 Speak the file.
virtual bool IsSpeaking () const=0
 Is it speaking?
virtual bool IsPaused () const
 Is it speaking?
virtual bool Stop ()=0
 Stop speaking.
virtual bool Pause ()
 Pause.
virtual bool Resume ()
 Pause.
virtual bool Skip (int WXUNUSED(toSkip), wxTTSSkipType WXUNUSED(itemType)=wxTTS_SkipSentence)
 Skip forward or backward the given number of items.
virtual bool CanSkip () const
 Can we skip right now?
virtual bool HasCapability (wxTTSCapability capability) const=0
 Does this handler have the specified capability?
virtual bool VoicesAreCompatible (const wxString &WXUNUSED(voice1), const wxString &WXUNUSED(voice2)) const
 Can these two voices be used together? Pass an empty string to the voice parameters to find out whether the engine in general supports simultaneous voices.
virtual bool ProcessInput ()
 For when the handler is using an external command, deal with input from command.
virtual wxString GetLastCommand () const
 Get last command, if using external command.
virtual void SetProperty (const wxTTSProperty &property)
 Set a property.
virtual void SetProperty (const wxString &name, const wxString &value)
virtual void SetProperty (const wxString &name, const wxString &value, const wxArrayString &choices)
virtual void SetProperty (const wxString &name, long value)
virtual void SetProperty (const wxString &name, int value)
virtual void SetProperty (const wxString &name, bool value)
virtual void SetProperty (const wxVariant &value)
virtual wxTTSProperty GetProperty (const wxString &name) const
 Get a property.
virtual wxVariant GetPropertyValue (const wxString &name) const
 Get a property value variant.
virtual wxString GetPropertyString (const wxString &name) const
 Get a string property value.
virtual long GetPropertyLong (const wxString &name) const
 Get a long property value.
virtual double GetPropertyDouble (const wxString &name) const
 Get a double property value.
virtual long GetPropertyBool (const wxString &name) const
 Get a bool property value.
virtual bool HasProperty (const wxString &name) const
 Does this property exist?
virtual wxArrayString EnumerateProperties () const
 Get current properties - doesn't necessarily mean they're all supported.
virtual int GetPropertyCount () const
 Get property count.
virtual wxTTSProperty GetProperty (size_t i) const
 Get property.
virtual const wxTTSPropertiesGetProperties () const
 Get properties.
virtual wxTTSPropertiesGetProperties ()
virtual void SetProgramLocation (const wxString &location)
 Set/get the program location.
virtual wxString GetProgramLocation () const
virtual void SetDataLocation (const wxString &location)
 Set/get the program location.
virtual wxString GetDataLocation () const
virtual void SetVoice (const wxString &voice)
 Set/get the voice.
virtual wxString GetVoice () const
virtual wxString GetDefaultVoice () const=0
 Get the default voice.
virtual wxArrayString GetAvailableVoices () const=0
 Get a list of the available voices.
virtual wxArrayString GetAvailableVoiceVariants () const
 Get a list of the available voice variants.
virtual void SetVoiceVariant (const wxString &variant)
 Set/get the voice variant.
virtual wxString GetVoiceVariant () const
virtual wxString GetDefaultVoiceVariant () const=0
 Get the default voice variant.
virtual void SetSpeed (int speed, wxTTSQuantityType quantity=wxTTS_NATIVE)
 Set/get the speed.
virtual int GetSpeed (wxTTSQuantityType quantity=wxTTS_NATIVE) const
virtual int GetMinSpeed () const=0
virtual int GetMaxSpeed () const=0
virtual void SetVolume (int vol, wxTTSQuantityType quantity=wxTTS_NATIVE)
 Set/get the volume.
virtual int GetVolume (wxTTSQuantityType quantity=wxTTS_NATIVE) const
virtual int GetMinVolume () const=0
virtual int GetMaxVolume () const=0
virtual void SetPitch (int pitch, wxTTSQuantityType quantity=wxTTS_NATIVE)
 Set/get the pitch.
virtual int GetPitch (wxTTSQuantityType quantity=wxTTS_NATIVE) const
virtual int GetMinPitch () const=0
virtual int GetMaxPitch () const=0
void SetErrorCode (int errorCode)
 Set/get the error code.
int GetErrorCode () const
void SetTextToSpeechObject (wxTextToSpeech *tts)
 Set/get a pointer to the parent text to speech object.
wxTextToSpeechGetTextToSpeechObject () const
void SetId (const wxString &id)
 Set/get the handler id.
wxString GetId () const
void SetDisplayName (const wxString &name)
 Set/get the handler display name.
const wxString & GetDisplayName () const
void SetDescription (const wxString &descr)
 Set/get the handler description.
const wxString & GetDescription () const
void Init ()
 Member initialisation.
bool GetInitialized () const
 Set/get initialized status.
void SetInitialized (bool init)
int GetOptions () const
 Set/get speak options.
void SetOptions (int options)
void DeleteTempFile ()
 Delete temporary file.
virtual int CreateTransformerOptions (int mandatoryOptions=0) const
 Create transformation options from handler's properties.
wxString DoTransformation (const wxString &originalFilename, int transformationFlags)
 Do the transformation.
wxTTSTransformerGetTransformer () const
 Get pronunciation table.

Static Public Member Functions

static int PercentToNativeValue (int value, int minValue, int maxValue)
 Helpers.
static int NativeValueToPercent (int value, int minValue, int maxValue)

Protected Attributes

int m_errorCode
int m_options
wxString m_tempFilename
wxString m_id
wxString m_displayName
wxString m_description
wxTextToSpeechm_textToSpeech
wxTTSProperties m_properties
bool m_isInitialized

Detailed Description

A base class for implementing a driver for a particular speech engine.


Constructor & Destructor Documentation

wxTTSHandler::wxTTSHandler ( const wxString &  id = wxEmptyString,
const wxString &  displayName = wxEmptyString 
)

wxTTSHandler::~wxTTSHandler (  ) 


Member Function Documentation

virtual bool wxTTSHandler::Initialize (  )  [inline, virtual]

Initialize the engine. Can call multiple times.

Reimplemented in wxTTSCepstralHandler, wxTTSEspeakHandler, wxTTSMacOSXHandler, wxTTSExternalCommandHandler, and wxTTSSapiHandler.

virtual bool wxTTSHandler::Uninitialize (  )  [inline, virtual]

Clean up the engine. Can call multiple times.

Reimplemented in wxTTSCepstralHandler, wxTTSEspeakHandler, wxTTSMacOSXHandler, wxTTSExternalCommandHandler, and wxTTSSapiHandler.

virtual bool wxTTSHandler::Speak ( const wxString &  text,
int  options = wxTTS_SPEAK_ASYNC 
) [pure virtual]

Speak the text.

Implemented in wxTTSCepstralHandler, wxTTSEspeakHandler, wxTTSMacOSXHandler, and wxTTSSapiHandler.

virtual bool wxTTSHandler::SpeakFile ( const wxString &  filename,
int  options = wxTTS_SPEAK_ASYNC,
const wxString &  waveFilename = wxEmptyString 
) [pure virtual]

Speak the file.

Implemented in wxTTSCepstralHandler, wxTTSEspeakHandler, wxTTSMacOSXHandler, and wxTTSSapiHandler.

virtual bool wxTTSHandler::IsSpeaking (  )  const [pure virtual]

Is it speaking?

Implemented in wxTTSCepstralHandler, wxTTSEspeakHandler, wxTTSMacOSXHandler, wxTTSExternalCommandHandler, and wxTTSSapiHandler.

virtual bool wxTTSHandler::IsPaused (  )  const [inline, virtual]

Is it speaking?

Reimplemented in wxTTSMacOSXHandler, and wxTTSSapiHandler.

virtual bool wxTTSHandler::Stop (  )  [pure virtual]

Stop speaking.

Implemented in wxTTSMacOSXHandler, wxTTSExternalCommandHandler, and wxTTSSapiHandler.

virtual bool wxTTSHandler::Pause (  )  [inline, virtual]

Pause.

Reimplemented in wxTTSMacOSXHandler, and wxTTSSapiHandler.

virtual bool wxTTSHandler::Resume (  )  [inline, virtual]

Pause.

Reimplemented in wxTTSMacOSXHandler, and wxTTSSapiHandler.

virtual bool wxTTSHandler::Skip ( int   WXUNUSED(toSkip),
wxTTSSkipType   WXUNUSED(itemType) = wxTTS_SkipSentence 
) [inline, virtual]

Skip forward or backward the given number of items.

A positive value skips forward, and a negative value skips back. A value of zero skips to the start of the item. itemType may be ignored by some or all engines.

virtual bool wxTTSHandler::CanSkip (  )  const [inline, virtual]

Can we skip right now?

Reimplemented in wxTTSSapiHandler.

virtual bool wxTTSHandler::HasCapability ( wxTTSCapability  capability  )  const [pure virtual]

Does this handler have the specified capability?

Implemented in wxTTSCepstralHandler, wxTTSEspeakHandler, wxTTSMacOSXHandler, and wxTTSSapiHandler.

virtual bool wxTTSHandler::VoicesAreCompatible ( const wxString &  WXUNUSED(voice1),
const wxString &  WXUNUSED(voice2) 
) const [inline, virtual]

Can these two voices be used together? Pass an empty string to the voice parameters to find out whether the engine in general supports simultaneous voices.

Pass voice names to find out if these voices can be used simultaneously, when using the given engine. The voice names can be the same.

virtual bool wxTTSHandler::ProcessInput (  )  [inline, virtual]

For when the handler is using an external command, deal with input from command.

Reimplemented in wxTTSExternalCommandHandler.

virtual wxString wxTTSHandler::GetLastCommand (  )  const [inline, virtual]

Get last command, if using external command.

Reimplemented in wxTTSExternalCommandHandler.

void wxTTSHandler::SetProperty ( const wxTTSProperty property  )  [virtual]

Set a property.

void wxTTSHandler::SetProperty ( const wxString &  name,
const wxString &  value 
) [virtual]

void wxTTSHandler::SetProperty ( const wxString &  name,
const wxString &  value,
const wxArrayString &  choices 
) [virtual]

void wxTTSHandler::SetProperty ( const wxString &  name,
long  value 
) [virtual]

void wxTTSHandler::SetProperty ( const wxString &  name,
int  value 
) [virtual]

void wxTTSHandler::SetProperty ( const wxString &  name,
bool  value 
) [virtual]

void wxTTSHandler::SetProperty ( const wxVariant &  value  )  [virtual]

wxTTSProperty wxTTSHandler::GetProperty ( const wxString &  name  )  const [virtual]

Get a property.

wxVariant wxTTSHandler::GetPropertyValue ( const wxString &  name  )  const [virtual]

Get a property value variant.

wxString wxTTSHandler::GetPropertyString ( const wxString &  name  )  const [virtual]

Get a string property value.

long wxTTSHandler::GetPropertyLong ( const wxString &  name  )  const [virtual]

Get a long property value.

double wxTTSHandler::GetPropertyDouble ( const wxString &  name  )  const [virtual]

Get a double property value.

long wxTTSHandler::GetPropertyBool ( const wxString &  name  )  const [virtual]

Get a bool property value.

bool wxTTSHandler::HasProperty ( const wxString &  name  )  const [virtual]

Does this property exist?

wxArrayString wxTTSHandler::EnumerateProperties (  )  const [virtual]

Get current properties - doesn't necessarily mean they're all supported.

virtual int wxTTSHandler::GetPropertyCount (  )  const [inline, virtual]

Get property count.

wxTTSProperty wxTTSHandler::GetProperty ( size_t  i  )  const [virtual]

Get property.

virtual const wxTTSProperties& wxTTSHandler::GetProperties (  )  const [inline, virtual]

Get properties.

virtual wxTTSProperties& wxTTSHandler::GetProperties (  )  [inline, virtual]

virtual void wxTTSHandler::SetProgramLocation ( const wxString &  location  )  [inline, virtual]

Set/get the program location.

Reimplemented in wxTTSEspeakHandler.

virtual wxString wxTTSHandler::GetProgramLocation (  )  const [inline, virtual]

virtual void wxTTSHandler::SetDataLocation ( const wxString &  location  )  [inline, virtual]

Set/get the program location.

virtual wxString wxTTSHandler::GetDataLocation (  )  const [inline, virtual]

virtual void wxTTSHandler::SetVoice ( const wxString &  voice  )  [inline, virtual]

Set/get the voice.

virtual wxString wxTTSHandler::GetVoice (  )  const [inline, virtual]

virtual wxString wxTTSHandler::GetDefaultVoice (  )  const [pure virtual]

Get the default voice.

Implemented in wxTTSCepstralHandler, wxTTSEspeakHandler, wxTTSMacOSXHandler, and wxTTSSapiHandler.

virtual wxArrayString wxTTSHandler::GetAvailableVoices (  )  const [pure virtual]

Get a list of the available voices.

Implemented in wxTTSCepstralHandler, wxTTSEspeakHandler, wxTTSMacOSXHandler, and wxTTSSapiHandler.

virtual wxArrayString wxTTSHandler::GetAvailableVoiceVariants (  )  const [inline, virtual]

Get a list of the available voice variants.

Reimplemented in wxTTSCepstralHandler, wxTTSEspeakHandler, wxTTSMacOSXHandler, and wxTTSSapiHandler.

virtual void wxTTSHandler::SetVoiceVariant ( const wxString &  variant  )  [inline, virtual]

Set/get the voice variant.

virtual wxString wxTTSHandler::GetVoiceVariant (  )  const [inline, virtual]

virtual wxString wxTTSHandler::GetDefaultVoiceVariant (  )  const [pure virtual]

Get the default voice variant.

Implemented in wxTTSCepstralHandler, wxTTSEspeakHandler, wxTTSMacOSXHandler, and wxTTSSapiHandler.

void wxTTSHandler::SetSpeed ( int  speed,
wxTTSQuantityType  quantity = wxTTS_NATIVE 
) [virtual]

Set/get the speed.

int wxTTSHandler::GetSpeed ( wxTTSQuantityType  quantity = wxTTS_NATIVE  )  const [virtual]

virtual int wxTTSHandler::GetMinSpeed (  )  const [pure virtual]

Implemented in wxTTSCepstralHandler, wxTTSEspeakHandler, wxTTSMacOSXHandler, and wxTTSSapiHandler.

virtual int wxTTSHandler::GetMaxSpeed (  )  const [pure virtual]

Implemented in wxTTSCepstralHandler, wxTTSEspeakHandler, wxTTSMacOSXHandler, and wxTTSSapiHandler.

void wxTTSHandler::SetVolume ( int  vol,
wxTTSQuantityType  quantity = wxTTS_NATIVE 
) [virtual]

Set/get the volume.

int wxTTSHandler::GetVolume ( wxTTSQuantityType  quantity = wxTTS_NATIVE  )  const [virtual]

virtual int wxTTSHandler::GetMinVolume (  )  const [pure virtual]

Implemented in wxTTSCepstralHandler, wxTTSEspeakHandler, wxTTSMacOSXHandler, and wxTTSSapiHandler.

virtual int wxTTSHandler::GetMaxVolume (  )  const [pure virtual]

Implemented in wxTTSCepstralHandler, wxTTSEspeakHandler, wxTTSMacOSXHandler, and wxTTSSapiHandler.

void wxTTSHandler::SetPitch ( int  pitch,
wxTTSQuantityType  quantity = wxTTS_NATIVE 
) [virtual]

Set/get the pitch.

int wxTTSHandler::GetPitch ( wxTTSQuantityType  quantity = wxTTS_NATIVE  )  const [virtual]

virtual int wxTTSHandler::GetMinPitch (  )  const [pure virtual]

Implemented in wxTTSCepstralHandler, wxTTSEspeakHandler, wxTTSMacOSXHandler, and wxTTSSapiHandler.

virtual int wxTTSHandler::GetMaxPitch (  )  const [pure virtual]

Implemented in wxTTSCepstralHandler, wxTTSEspeakHandler, wxTTSMacOSXHandler, and wxTTSSapiHandler.

void wxTTSHandler::SetErrorCode ( int  errorCode  )  [inline]

Set/get the error code.

Reimplemented in wxTTSExternalCommandHandler.

int wxTTSHandler::GetErrorCode (  )  const [inline]

Reimplemented in wxTTSExternalCommandHandler.

void wxTTSHandler::SetTextToSpeechObject ( wxTextToSpeech tts  )  [inline]

Set/get a pointer to the parent text to speech object.

wxTextToSpeech* wxTTSHandler::GetTextToSpeechObject (  )  const [inline]

void wxTTSHandler::SetId ( const wxString &  id  )  [inline]

Set/get the handler id.

wxString wxTTSHandler::GetId (  )  const [inline]

void wxTTSHandler::SetDisplayName ( const wxString &  name  )  [inline]

Set/get the handler display name.

const wxString& wxTTSHandler::GetDisplayName (  )  const [inline]

void wxTTSHandler::SetDescription ( const wxString &  descr  )  [inline]

Set/get the handler description.

const wxString& wxTTSHandler::GetDescription (  )  const [inline]

void wxTTSHandler::Init (  ) 

Member initialisation.

Reimplemented in wxTTSCepstralHandler, wxTTSEspeakHandler, wxTTSMacOSXHandler, wxTTSExternalCommandHandler, and wxTTSSapiHandler.

bool wxTTSHandler::GetInitialized (  )  const [inline]

Set/get initialized status.

void wxTTSHandler::SetInitialized ( bool  init  )  [inline]

int wxTTSHandler::GetOptions (  )  const [inline]

Set/get speak options.

void wxTTSHandler::SetOptions ( int  options  )  [inline]

void wxTTSHandler::DeleteTempFile (  ) 

Delete temporary file.

int wxTTSHandler::PercentToNativeValue ( int  value,
int  minValue,
int  maxValue 
) [static]

Helpers.

int wxTTSHandler::NativeValueToPercent ( int  value,
int  minValue,
int  maxValue 
) [static]

int wxTTSHandler::CreateTransformerOptions ( int  mandatoryOptions = 0  )  const [virtual]

Create transformation options from handler's properties.

Reimplemented in wxTTSSapiHandler.

wxString wxTTSHandler::DoTransformation ( const wxString &  originalFilename,
int  transformationFlags 
)

Do the transformation.

wxTTSTransformer * wxTTSHandler::GetTransformer (  )  const

Get pronunciation table.


Member Data Documentation

int wxTTSHandler::m_errorCode [protected]

Reimplemented in wxTTSExternalCommandHandler.

int wxTTSHandler::m_options [protected]

wxString wxTTSHandler::m_tempFilename [protected]

wxString wxTTSHandler::m_id [protected]

wxString wxTTSHandler::m_displayName [protected]

wxString wxTTSHandler::m_description [protected]

wxTextToSpeech* wxTTSHandler::m_textToSpeech [protected]

wxTTSProperties wxTTSHandler::m_properties [protected]

bool wxTTSHandler::m_isInitialized [protected]


The documentation for this class was generated from the following files:
Generated on Wed May 6 19:20:23 2009 for AxTk by  doxygen 1.5.1