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

Classes

interface  TextToSpeechCallback
 

Public Member Functions

void speak (String message, Locale loc)
 
void onStop ()
 
void onResume ()
 
void onDestroy ()
 
void setPitch (float pitch)
 
void setSpeechRate (float speechRate)
 
int isLanguageAvailable (Locale loc)
 
boolean isInitialized ()
 

Detailed Description

This abstracts out what a text to speech implementation needs to have. In particular we use this to enable having an implementation that uses the internal Android TextToSpeech library for post-Donut devices and uses an externally installed library for the earlier devices.

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

Definition at line 19 of file ITextToSpeech.java.

Member Function Documentation

◆ isInitialized()

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

◆ isLanguageAvailable()

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

◆ onDestroy()

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

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

Implemented in com.google.appinventor.components.runtime.util.InternalTextToSpeech, and com.google.appinventor.components.runtime.util.ExternalTextToSpeech.

◆ onResume()

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

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

Implemented in com.google.appinventor.components.runtime.util.InternalTextToSpeech, and com.google.appinventor.components.runtime.util.ExternalTextToSpeech.

◆ onStop()

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

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

Implemented in com.google.appinventor.components.runtime.util.InternalTextToSpeech, and com.google.appinventor.components.runtime.util.ExternalTextToSpeech.

◆ setPitch()

void com.google.appinventor.components.runtime.util.ITextToSpeech.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.

Implemented in com.google.appinventor.components.runtime.util.InternalTextToSpeech, and com.google.appinventor.components.runtime.util.ExternalTextToSpeech.

◆ setSpeechRate()

void com.google.appinventor.components.runtime.util.ITextToSpeech.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).

Implemented in com.google.appinventor.components.runtime.util.InternalTextToSpeech, and com.google.appinventor.components.runtime.util.ExternalTextToSpeech.

◆ speak()

void com.google.appinventor.components.runtime.util.ITextToSpeech.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

Implemented in com.google.appinventor.components.runtime.util.ExternalTextToSpeech, and com.google.appinventor.components.runtime.util.InternalTextToSpeech.


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