ScummVM API documentation
AndroidTextToSpeechManager Class Referencefinal
Inheritance diagram for AndroidTextToSpeechManager:
Common::TextToSpeechManager

Public Types

enum  SpeechState { BROKEN, READY, SPEAKING, PAUSED }
 
- Public Types inherited from Common::TextToSpeechManager
enum  Action {
  INTERRUPT, INTERRUPT_NO_REPEAT, QUEUE, QUEUE_NO_REPEAT,
  DROP
}
 

Public Member Functions

bool say (const Common::U32String &str, Action action) override
 
bool stop () override
 
bool pause () override
 
bool resume () override
 
bool isSpeaking () override
 
bool isPaused () override
 
bool isReady () override
 
void setVoice (unsigned index) override
 
void freeVoiceData (void *data) override
 
void setLanguage (Common::String language) override
 
- Public Member Functions inherited from Common::TextToSpeechManager
 TextToSpeechManager ()
 
bool say (const String &str, Action action, CodePage charset=kUtf8)
 
bool say (const U32String &str)
 
bool say (const String &str, CodePage charset=kUtf8)
 
TTSVoice getVoice ()
 
virtual void setRate (int rate)
 
int getRate ()
 
virtual void setPitch (int pitch)
 
int getPitch ()
 
virtual void setVolume (unsigned volume)
 
int getVolume ()
 
String getLanguage ()
 
Array< TTSVoicegetVoicesArray ()
 
Array< int > getVoiceIndicesByGender (TTSVoice::Gender gender)
 
virtual int getDefaultVoice ()
 
void pushState ()
 
bool popState ()
 
void enable (bool on)
 

Static Public Member Functions

static void initJNI (JNIEnv *env)
 

Additional Inherited Members

- Protected Member Functions inherited from Common::TextToSpeechManager
void clearState ()
 
- Protected Attributes inherited from Common::TextToSpeechManager
TTSState_ttsState
 

Member Function Documentation

◆ say()

bool AndroidTextToSpeechManager::say ( const Common::U32String str,
Action  action 
)
overridevirtual

Says the given string

Parameters
strThe string to say
actionWhat to do if another string is just being said. Possible actions are: INTERRUPT - interrupts the current speech INTERRUPT_NO_REPEAT - interrupts the speech (deletes the whole queue), if the str is the same as the string currently being said, it lets the current string finish and drops the new request. QUEUE - queues the speech QUEUE_NO_REPEAT - queues the speech only if the str is different than the last string in the queue (or the string, that is currently being said if the queue is empty) DROP - does nothing if there is anything being said at the moment

Reimplemented from Common::TextToSpeechManager.

◆ stop()

bool AndroidTextToSpeechManager::stop ( )
overridevirtual

Stops the speech

Reimplemented from Common::TextToSpeechManager.

◆ pause()

bool AndroidTextToSpeechManager::pause ( )
overridevirtual

Pauses the speech

Reimplemented from Common::TextToSpeechManager.

◆ resume()

bool AndroidTextToSpeechManager::resume ( )
overridevirtual

Resumes the speech

Note
On linux, the speech resumes from the beginning of the last speech being said, when pause() was called. On other platforms the speech resumes from exactly where it was paused();

Reimplemented from Common::TextToSpeechManager.

◆ isSpeaking()

bool AndroidTextToSpeechManager::isSpeaking ( )
inlineoverridevirtual

Returns true, if the TTS engine is speaking

Reimplemented from Common::TextToSpeechManager.

◆ isPaused()

bool AndroidTextToSpeechManager::isPaused ( )
inlineoverridevirtual

Returns true, if the TTS engine is paused

Reimplemented from Common::TextToSpeechManager.

◆ isReady()

bool AndroidTextToSpeechManager::isReady ( )
inlineoverridevirtual

Returns true, if the TTS engine is ready to speak (isn't speaking and isn't paused)

Reimplemented from Common::TextToSpeechManager.

◆ setVoice()

void AndroidTextToSpeechManager::setVoice ( unsigned  index)
overridevirtual

Sets a voice to be used by the TTS.

Parameters
indexThe index of the voice inside the _ttsState->_availableVoices array

Reimplemented from Common::TextToSpeechManager.

◆ freeVoiceData()

void AndroidTextToSpeechManager::freeVoiceData ( void *  data)
inlineoverridevirtual

Frees the _data field from TTSVoice

Reimplemented from Common::TextToSpeechManager.

◆ setLanguage()

void AndroidTextToSpeechManager::setLanguage ( Common::String  language)
overridevirtual

Sets the speech language

Parameters
languageThe language identifier as defined by ISO 639-1
Note
After using this method, it is probably a good idea to use setVoice, because voices are usually language specific and so it is set to some platform specific default after switching languages.

Reimplemented from Common::TextToSpeechManager.


The documentation for this class was generated from the following file: