#include <tts/tts.h>
Public Member Functions | |
wxTextToSpeech () | |
~wxTextToSpeech () | |
void | Init () |
Member initialisation. | |
virtual bool | Speak (const wxString &text, int options=wxTTS_SPEAK_ASYNC) |
Speak the text. | |
virtual bool | SpeakFile (const wxString &filename, int options=wxTTS_SPEAK_ASYNC, const wxString &waveFilename=wxEmptyString) |
Speak the file. | |
virtual bool | IsSpeaking () const |
Is it speaking (possibly paused)? | |
virtual bool | IsPlaying () const |
Is it playing (speaking and not paused)? | |
virtual bool | Stop () |
Stop speaking. | |
virtual bool | Pause () |
Pause. | |
virtual bool | Resume () |
Resume. | |
virtual bool | IsPaused () const |
Is it paused? | |
virtual bool | CanPause () const |
Can we pause right now? | |
virtual bool | Skip (int toSkip, wxTTSSkipType 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 |
Does this handler have the specified capability? | |
void | SetProperty (const wxTTSProperty &property) |
Set a property. | |
void | SetProperty (const wxString &name, const wxString &value) |
void | SetProperty (const wxString &name, const wxString &value, const wxArrayString &choices) |
void | SetProperty (const wxString &name, long value) |
void | SetProperty (const wxString &name, int value) |
void | SetProperty (const wxString &name, bool value) |
void | SetProperty (const wxVariant &value) |
wxTTSProperty | GetProperty (const wxString &name) const |
Get a property. | |
wxVariant | GetPropertyValue (const wxString &name) const |
Get a property value variant. | |
wxString | GetPropertyString (const wxString &name) const |
Get a string property value. | |
long | GetPropertyLong (const wxString &name) const |
Get a long property value. | |
double | GetPropertyDouble (const wxString &name) const |
Get a double property value. | |
long | GetPropertyBool (const wxString &name) const |
Get a bool property value. | |
bool | HasProperty (const wxString &name) const |
Does this property exist? | |
wxArrayString | EnumerateProperties () const |
Get current properties - doesn't necessarily mean they're all supported. | |
int | GetPropertyCount () const |
Get property count. | |
wxTTSProperty | GetProperty (size_t i) const |
Get property. | |
wxTTSTransformer * | GetTransformer () const |
Set the pronunciation table. | |
void | SetTransformer (wxTTSTransformer *transformer) |
Get the pronunciation table. | |
void | SetProgramLocation (const wxString &location) |
Set the program location. | |
wxString | GetProgramLocation () const |
Get the program location. | |
void | SetDataLocation (const wxString &location) |
Set the program location. | |
wxString | GetDataLocation () const |
Get the program location. | |
void | SetVoice (const wxString &voice) |
Set the voice. | |
wxString | GetVoice () const |
Get the voice. | |
wxString | GetDefaultVoice () const |
Get the default voice. | |
void | SetVoiceVariant (const wxString &variant) |
Set the voice variant. | |
wxString | GetVoiceVariant () const |
Get the voice variant. | |
wxString | GetDefaultVoiceVariant () const |
Get the default voice variant. | |
bool | VoicesAreCompatible (const wxString &engine, const wxString &voice1, const wxString &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. | |
bool | VoicesAreCompatible (const wxString &voice1, const wxString &voice2) const |
void | SetSpeed (int speed, wxTTSQuantityType quantity=wxTTS_NATIVE) |
Set the speed. | |
int | GetSpeed (wxTTSQuantityType quantity=wxTTS_NATIVE) const |
Get the speed. | |
void | SetVolume (int vol, wxTTSQuantityType quantity=wxTTS_NATIVE) |
Set the volume. | |
int | GetVolume (wxTTSQuantityType quantity=wxTTS_NATIVE) const |
Get the volume. | |
void | SetPitch (int pitch, wxTTSQuantityType quantity=wxTTS_NATIVE) |
Set the pitch. | |
int | GetPitch (wxTTSQuantityType quantity=wxTTS_NATIVE) const |
Get the pitch. | |
void | SetPriority (int priority) |
Set the priority. | |
int | GetPriority () const |
Get the priority. | |
void | SetErrorCode (int errorCode) |
Set the error code. | |
int | GetErrorCode () const |
Get the error code. | |
wxArrayString | GetAvailableVoices () const |
Get a list of the available voices. | |
wxArrayString | GetAvailableVoiceVariants () const |
Get a list of the available voice variants. | |
wxArrayString | GetEngineIds () const |
Get a list of the available engine ids. | |
wxArrayString | GetEngineDisplayNames () const |
Get a list of the available engine display names. | |
wxArrayString | GetEngineDescriptions () const |
Get a list of the available engine descriptions. | |
wxTTSHandler * | GetCurrentHandler () const |
Get current handler. | |
void | SetCurrentHandler (wxTTSHandler *handler) |
Set current handler. | |
bool | AddHandler (wxTTSHandler *handler) |
Add handler. | |
wxTTSHandler * | FindHandler (const wxString &name) const |
Find handler by id. | |
int | GetHandlerCount () const |
Get handler ccount. | |
wxTTSHandler * | GetHandler (size_t i) const |
Get handler. | |
void | ClearHandlers () |
Remove all handlers, uninitializing each one. | |
bool | SetEngine (const wxString &id) |
Set current engine by id. | |
wxString | GetEngine () const |
Get current engine by id. | |
bool | ProcessInput () |
For when the handler is using an external command, deal with input from command. | |
wxString | GetLastCommand () const |
Get last command, if using external command. | |
Static Public Member Functions | |
static wxString | AppendPaths (const wxString &p1, const wxString &p2, const wxString &sep=wxFILE_SEP_PATH) |
Append paths without duplicating separator. | |
static bool | StripExtension (wxString &path, const wxString &validExtensions=wxEmptyString) |
Intelligent strip extension: don't strip before a separator, and don't strip if the 'extension' is different from the passed extension that we expect - can be comma-separated list. | |
static wxString | FindHtmlEncoding (const wxString &filename) |
Find the encoding of an HTML file. | |
static wxString | FindXmlEncoding (const wxString &filename) |
Find the encoding of an XML file. | |
static bool | IsXmlString (const wxString &text) |
Is this an XML string? | |
static bool | IsXmlFile (const wxString &filename) |
Is this an XML file? | |
Protected Attributes | |
int | m_errorCode |
wxList | m_handlers |
wxTTSHandler * | m_currentHandler |
wxTTSTransformer * | m_transformer |
wxTextToSpeech::wxTextToSpeech | ( | ) |
wxTextToSpeech::~wxTextToSpeech | ( | ) |
bool wxTextToSpeech::AddHandler | ( | wxTTSHandler * | handler | ) |
Add handler.
wxString wxTextToSpeech::AppendPaths | ( | const wxString & | p1, | |
const wxString & | p2, | |||
const wxString & | sep = wxFILE_SEP_PATH | |||
) | [static] |
Append paths without duplicating separator.
bool wxTextToSpeech::CanPause | ( | ) | const [virtual] |
Can we pause right now?
bool wxTextToSpeech::CanSkip | ( | ) | const [virtual] |
Can we skip right now?
void wxTextToSpeech::ClearHandlers | ( | ) |
Remove all handlers, uninitializing each one.
wxArrayString wxTextToSpeech::EnumerateProperties | ( | ) | const |
Get current properties - doesn't necessarily mean they're all supported.
wxTTSHandler * wxTextToSpeech::FindHandler | ( | const wxString & | name | ) | const |
Find handler by id.
wxString wxTextToSpeech::FindHtmlEncoding | ( | const wxString & | filename | ) | [static] |
Find the encoding of an HTML file.
wxString wxTextToSpeech::FindXmlEncoding | ( | const wxString & | filename | ) | [static] |
Find the encoding of an XML file.
wxArrayString wxTextToSpeech::GetAvailableVoices | ( | ) | const |
Get a list of the available voices.
wxArrayString wxTextToSpeech::GetAvailableVoiceVariants | ( | ) | const |
Get a list of the available voice variants.
wxTTSHandler* wxTextToSpeech::GetCurrentHandler | ( | ) | const [inline] |
Get current handler.
wxString wxTextToSpeech::GetDataLocation | ( | ) | const |
Get the program location.
wxString wxTextToSpeech::GetDefaultVoice | ( | ) | const |
Get the default voice.
wxString wxTextToSpeech::GetDefaultVoiceVariant | ( | ) | const |
Get the default voice variant.
wxString wxTextToSpeech::GetEngine | ( | ) | const |
Get current engine by id.
wxArrayString wxTextToSpeech::GetEngineDescriptions | ( | ) | const |
Get a list of the available engine descriptions.
wxArrayString wxTextToSpeech::GetEngineDisplayNames | ( | ) | const |
Get a list of the available engine display names.
wxArrayString wxTextToSpeech::GetEngineIds | ( | ) | const |
Get a list of the available engine ids.
int wxTextToSpeech::GetErrorCode | ( | ) | const [inline] |
Get the error code.
wxTTSHandler * wxTextToSpeech::GetHandler | ( | size_t | i | ) | const |
Get handler.
int wxTextToSpeech::GetHandlerCount | ( | ) | const [inline] |
Get handler ccount.
wxString wxTextToSpeech::GetLastCommand | ( | ) | const |
Get last command, if using external command.
int wxTextToSpeech::GetPitch | ( | wxTTSQuantityType | quantity = wxTTS_NATIVE |
) | const |
Get the pitch.
int wxTextToSpeech::GetPriority | ( | ) | const |
Get the priority.
wxString wxTextToSpeech::GetProgramLocation | ( | ) | const |
Get the program location.
wxTTSProperty wxTextToSpeech::GetProperty | ( | size_t | i | ) | const |
Get property.
wxTTSProperty wxTextToSpeech::GetProperty | ( | const wxString & | name | ) | const |
Get a property.
long wxTextToSpeech::GetPropertyBool | ( | const wxString & | name | ) | const |
Get a bool property value.
int wxTextToSpeech::GetPropertyCount | ( | ) | const |
Get property count.
double wxTextToSpeech::GetPropertyDouble | ( | const wxString & | name | ) | const |
Get a double property value.
long wxTextToSpeech::GetPropertyLong | ( | const wxString & | name | ) | const |
Get a long property value.
wxString wxTextToSpeech::GetPropertyString | ( | const wxString & | name | ) | const |
Get a string property value.
wxVariant wxTextToSpeech::GetPropertyValue | ( | const wxString & | name | ) | const |
Get a property value variant.
int wxTextToSpeech::GetSpeed | ( | wxTTSQuantityType | quantity = wxTTS_NATIVE |
) | const |
Get the speed.
wxTTSTransformer* wxTextToSpeech::GetTransformer | ( | ) | const [inline] |
Set the pronunciation table.
wxString wxTextToSpeech::GetVoice | ( | ) | const |
Get the voice.
wxString wxTextToSpeech::GetVoiceVariant | ( | ) | const |
Get the voice variant.
int wxTextToSpeech::GetVolume | ( | wxTTSQuantityType | quantity = wxTTS_NATIVE |
) | const |
Get the volume.
bool wxTextToSpeech::HasCapability | ( | wxTTSCapability | capability | ) | const [virtual] |
Does this handler have the specified capability?
bool wxTextToSpeech::HasProperty | ( | const wxString & | name | ) | const |
Does this property exist?
void wxTextToSpeech::Init | ( | ) |
Member initialisation.
bool wxTextToSpeech::IsPaused | ( | ) | const [virtual] |
Is it paused?
virtual bool wxTextToSpeech::IsPlaying | ( | ) | const [inline, virtual] |
Is it playing (speaking and not paused)?
bool wxTextToSpeech::IsSpeaking | ( | ) | const [virtual] |
Is it speaking (possibly paused)?
bool wxTextToSpeech::IsXmlFile | ( | const wxString & | filename | ) | [static] |
Is this an XML file?
bool wxTextToSpeech::IsXmlString | ( | const wxString & | text | ) | [static] |
Is this an XML string?
bool wxTextToSpeech::Pause | ( | ) | [virtual] |
Pause.
bool wxTextToSpeech::ProcessInput | ( | ) |
For when the handler is using an external command, deal with input from command.
bool wxTextToSpeech::Resume | ( | ) | [virtual] |
Resume.
void wxTextToSpeech::SetCurrentHandler | ( | wxTTSHandler * | handler | ) | [inline] |
Set current handler.
void wxTextToSpeech::SetDataLocation | ( | const wxString & | location | ) |
Set the program location.
bool wxTextToSpeech::SetEngine | ( | const wxString & | id | ) |
Set current engine by id.
void wxTextToSpeech::SetErrorCode | ( | int | errorCode | ) | [inline] |
Set the error code.
void wxTextToSpeech::SetPitch | ( | int | pitch, | |
wxTTSQuantityType | quantity = wxTTS_NATIVE | |||
) |
Set the pitch.
void wxTextToSpeech::SetPriority | ( | int | priority | ) |
Set the priority.
0 (wxTTS_Normal) is normal priority, 1 (wxTTS_Alert) is alert priority, and 2 (wxTTS_Over) is over priority, which mixes audio with other audio on the system. Using wxTTS_Over can cause crashes for engines that are not coded for re-entrancy.
void wxTextToSpeech::SetProgramLocation | ( | const wxString & | location | ) |
Set the program location.
void wxTextToSpeech::SetProperty | ( | const wxVariant & | value | ) |
void wxTextToSpeech::SetProperty | ( | const wxString & | name, | |
bool | value | |||
) |
void wxTextToSpeech::SetProperty | ( | const wxString & | name, | |
int | value | |||
) |
void wxTextToSpeech::SetProperty | ( | const wxString & | name, | |
long | value | |||
) |
void wxTextToSpeech::SetProperty | ( | const wxString & | name, | |
const wxString & | value, | |||
const wxArrayString & | choices | |||
) |
void wxTextToSpeech::SetProperty | ( | const wxString & | name, | |
const wxString & | value | |||
) |
void wxTextToSpeech::SetProperty | ( | const wxTTSProperty & | property | ) |
Set a property.
void wxTextToSpeech::SetSpeed | ( | int | speed, | |
wxTTSQuantityType | quantity = wxTTS_NATIVE | |||
) |
Set the speed.
void wxTextToSpeech::SetTransformer | ( | wxTTSTransformer * | transformer | ) | [inline] |
Get the pronunciation table.
void wxTextToSpeech::SetVoice | ( | const wxString & | voice | ) |
Set the voice.
void wxTextToSpeech::SetVoiceVariant | ( | const wxString & | variant | ) |
Set the voice variant.
void wxTextToSpeech::SetVolume | ( | int | vol, | |
wxTTSQuantityType | quantity = wxTTS_NATIVE | |||
) |
Set the volume.
bool wxTextToSpeech::Skip | ( | int | toSkip, | |
wxTTSSkipType | itemType = wxTTS_SkipSentence | |||
) | [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.
bool wxTextToSpeech::Speak | ( | const wxString & | text, | |
int | options = wxTTS_SPEAK_ASYNC | |||
) | [virtual] |
Speak the text.
bool wxTextToSpeech::SpeakFile | ( | const wxString & | filename, | |
int | options = wxTTS_SPEAK_ASYNC , |
|||
const wxString & | waveFilename = wxEmptyString | |||
) | [virtual] |
Speak the file.
bool wxTextToSpeech::Stop | ( | ) | [virtual] |
Stop speaking.
bool wxTextToSpeech::StripExtension | ( | wxString & | path, | |
const wxString & | validExtensions = wxEmptyString | |||
) | [static] |
Intelligent strip extension: don't strip before a separator, and don't strip if the 'extension' is different from the passed extension that we expect - can be comma-separated list.
bool wxTextToSpeech::VoicesAreCompatible | ( | const wxString & | voice1, | |
const wxString & | voice2 | |||
) | const |
bool wxTextToSpeech::VoicesAreCompatible | ( | const wxString & | engine, | |
const wxString & | voice1, | |||
const wxString & | 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.
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. The reason why we can't just ask whether one voice is compatible with itself, is that the same engine may provide several different voices, so we have to look for similarities in the voice names.
Find handler by id
wxTTSHandler* wxTextToSpeech::m_currentHandler [protected] |
int wxTextToSpeech::m_errorCode [protected] |
wxList wxTextToSpeech::m_handlers [protected] |
wxTTSTransformer* wxTextToSpeech::m_transformer [protected] |