AI2 Component  (Version nb184)
com.google.appinventor.components.runtime.util.ExternalTextToSpeech Class Reference
Inheritance diagram for com.google.appinventor.components.runtime.util.ExternalTextToSpeech:
com.google.appinventor.components.runtime.util.ITextToSpeech com.google.appinventor.components.runtime.ActivityResultListener

Public Member Functions

 ExternalTextToSpeech (ComponentContainer container, TextToSpeechCallback callback)
 
void speak (String message, Locale loc)
 
void onDestroy ()
 
void onStop ()
 
void onResume ()
 
void setPitch (float pitch)
 
void setSpeechRate (float speechRate)
 
void resultReturned (int requestCode, int resultCode, Intent data)
 
int isLanguageAvailable (Locale loc)
 
boolean isInitialized ()
 

Detailed Description

Wrapper class for delegating calls to an external text-to-speech library for devices lacking an internal text-to-speech library (pre-1.6).

Author
markf.nosp@m.@goo.nosp@m.gle.c.nosp@m.om (Mark Friedman)

Definition at line 29 of file ExternalTextToSpeech.java.

Constructor & Destructor Documentation

◆ ExternalTextToSpeech()

com.google.appinventor.components.runtime.util.ExternalTextToSpeech.ExternalTextToSpeech ( ComponentContainer  container,
TextToSpeechCallback  callback 
)

Definition at line 41 of file ExternalTextToSpeech.java.

Member Function Documentation

◆ isInitialized()

boolean com.google.appinventor.components.runtime.util.ExternalTextToSpeech.isInitialized ( )

◆ isLanguageAvailable()

int com.google.appinventor.components.runtime.util.ExternalTextToSpeech.isLanguageAvailable ( Locale  loc)

◆ onDestroy()

void com.google.appinventor.components.runtime.util.ExternalTextToSpeech.onDestroy ( )

This will be called when the Activity is destroyed, to give us a chance to cleanup resources, if necessary.

Implements com.google.appinventor.components.runtime.util.ITextToSpeech.

Definition at line 63 of file ExternalTextToSpeech.java.

◆ onResume()

void com.google.appinventor.components.runtime.util.ExternalTextToSpeech.onResume ( )

This will be called when the Activity is resumed, to give us a chance to re-initialize resources, if necessary.

Implements com.google.appinventor.components.runtime.util.ITextToSpeech.

Definition at line 73 of file ExternalTextToSpeech.java.

◆ onStop()

void com.google.appinventor.components.runtime.util.ExternalTextToSpeech.onStop ( )

This will be called when the Activity is stopped, to give us a chance to cleanup resources, if necessary.

Implements com.google.appinventor.components.runtime.util.ITextToSpeech.

Definition at line 68 of file ExternalTextToSpeech.java.

◆ resultReturned()

void com.google.appinventor.components.runtime.util.ExternalTextToSpeech.resultReturned ( int  requestCode,
int  resultCode,
Intent  data 
)

The callback method used to report Activity results back to the caller.

Parameters
requestCodethe originally passed in request code. Used to identify the call.
resultCodethe returned result code: android.app.Activity#RESULT_OK or android.app.Activity#RESULT_CANCELED
datathe returned data, encapsulated as an Intent.

Implements com.google.appinventor.components.runtime.ActivityResultListener.

Definition at line 88 of file ExternalTextToSpeech.java.

◆ setPitch()

void com.google.appinventor.components.runtime.util.ExternalTextToSpeech.setPitch ( float  pitch)

Sets the speech pitch for the TextToSpeech

Parameters
pitch1.0 is the normal pitch, lower values lower the tone of the synthesized voice, greater values increase it.

Implements com.google.appinventor.components.runtime.util.ITextToSpeech.

Definition at line 78 of file ExternalTextToSpeech.java.

◆ setSpeechRate()

void com.google.appinventor.components.runtime.util.ExternalTextToSpeech.setSpeechRate ( float  speechRate)

Sets the speech rate

Parameters
speechRateSpeech rate. 1.0 is the normal speech rate, lower values slow down the speech (0.5 is half the normal speech rate), greater values accelerate it (2.0 is twice the normal speech rate).

Implements com.google.appinventor.components.runtime.util.ITextToSpeech.

Definition at line 83 of file ExternalTextToSpeech.java.

◆ speak()

void com.google.appinventor.components.runtime.util.ExternalTextToSpeech.speak ( String  message,
Locale  loc 
)

Speaks the given message corresponding to the language and country of the given locale.

Parameters
messagethe message to speak
locthe locale to use

Implements com.google.appinventor.components.runtime.util.ITextToSpeech.

Definition at line 48 of file ExternalTextToSpeech.java.


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