public class NacTextToSpeech
extends java.lang.Object
implements android.speech.tts.TextToSpeech.OnInitListener, android.media.AudioManager.OnAudioFocusChangeListener
Modifier and Type | Class and Description |
---|---|
static class |
NacTextToSpeech.NacUtteranceListener |
static interface |
NacTextToSpeech.OnSpeakingListener
On speaking listener.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
UTTERANCE_ID
Utterance ID when speaking through the TTS engine.
|
Constructor and Description |
---|
NacTextToSpeech(android.content.Context context,
NacTextToSpeech.OnSpeakingListener listener) |
Modifier and Type | Method and Description |
---|---|
NacAudio.Attributes |
getAudioAttributes() |
boolean |
hasBuffer() |
boolean |
isInitialized() |
boolean |
isSpeaking() |
void |
onAudioFocusChange(int focusChange)
Change media state when audio focus changes.
|
void |
onInit(int status) |
void |
setOnSpeakingListener(NacTextToSpeech.OnSpeakingListener listener)
Set on speaking listener.
|
void |
shutdown()
Shutdown the speech engine.
|
void |
speak(java.lang.String message) |
void |
speak(java.lang.String message,
NacAudio.Attributes attrs)
Speak the given text.
|
public static final java.lang.String UTTERANCE_ID
public NacTextToSpeech(android.content.Context context, NacTextToSpeech.OnSpeakingListener listener)
public NacAudio.Attributes getAudioAttributes()
public boolean hasBuffer()
public boolean isInitialized()
public boolean isSpeaking()
public void onAudioFocusChange(int focusChange)
onAudioFocusChange
in interface android.media.AudioManager.OnAudioFocusChangeListener
public void onInit(int status)
onInit
in interface android.speech.tts.TextToSpeech.OnInitListener
public void setOnSpeakingListener(NacTextToSpeech.OnSpeakingListener listener)
public void shutdown()
public void speak(java.lang.String message)
speak(String, NacAudio.Attributes)
public void speak(java.lang.String message, NacAudio.Attributes attrs)