FileDocCategorySizeDatePackage
ITextToSpeechService.javaAPI DocAndroid 5.1 API33037Sat Mar 14 05:48:08 GMT 2015android.speech.tts

ITextToSpeechService

public interface ITextToSpeechService implements android.os.IInterface
Interface for TextToSpeech to talk to TextToSpeechService. {@hide}

Fields Summary
Constructors Summary
Methods Summary
public java.lang.String[]getClientDefaultLanguage()
Returns a default TTS language, country and variant as set by the user. Can be called from multiple threads.

return
A 3-element array, containing language (ISO 3-letter code), country (ISO 3-letter code) and variant used by the engine. The country and variant may be {@code ""}. If country is empty, then variant must be empty too.

public java.lang.StringgetDefaultVoiceNameFor(java.lang.String lang, java.lang.String country, java.lang.String variant)
Return a name of the default voice for a given locale. This allows {@link TextToSpeech#getVoice} to return a sensible value after a client calls {@link TextToSpeech#setLanguage}.

param
lang ISO 3-character language code.
param
country ISO 3-character country code. May be empty or null.
param
variant Language variant. May be empty or null.
return
Code indicating the support status for the locale. One of {@link TextToSpeech#LANG_AVAILABLE}, {@link TextToSpeech#LANG_COUNTRY_AVAILABLE}, {@link TextToSpeech#LANG_COUNTRY_VAR_AVAILABLE}, {@link TextToSpeech#LANG_MISSING_DATA} {@link TextToSpeech#LANG_NOT_SUPPORTED}.

public java.lang.String[]getFeaturesForLanguage(java.lang.String lang, java.lang.String country, java.lang.String variant)
Returns a list of features available for a given language. Elements of the returned string array can be passed in as keys to {@link TextToSpeech#speak} and {@link TextToSpeech#synthesizeToFile} to select a given feature or features to be used during synthesis.

param
lang ISO-3 language code.
param
country ISO-3 country code. May be empty or null.
param
variant Language variant. May be empty or null.
return
An array of strings containing the set of features supported for the supplied locale. The array of strings must not contain duplicates.

public java.lang.String[]getLanguage()
Returns the language, country and variant currently being used by the TTS engine. Can be called from multiple threads.

return
A 3-element array, containing language (ISO 3-letter code), country (ISO 3-letter code) and variant used by the engine. The country and variant may be {@code ""}. If country is empty, then variant must be empty too.

public java.util.ListgetVoices()
Get the array of available voices.

public intisLanguageAvailable(java.lang.String lang, java.lang.String country, java.lang.String variant)
Checks whether the engine supports a given language.

param
lang ISO-3 language code.
param
country ISO-3 country code. May be empty or null.
param
variant Language variant. May be empty or null.
return
Code indicating the support status for the locale. One of {@link TextToSpeech#LANG_AVAILABLE}, {@link TextToSpeech#LANG_COUNTRY_AVAILABLE}, {@link TextToSpeech#LANG_COUNTRY_VAR_AVAILABLE}, {@link TextToSpeech#LANG_MISSING_DATA} {@link TextToSpeech#LANG_NOT_SUPPORTED}.

public booleanisSpeaking()
Checks whether the service is currently playing some audio.

public intloadLanguage(android.os.IBinder caller, java.lang.String lang, java.lang.String country, java.lang.String variant)
Notifies the engine that it should load a speech synthesis language.

param
caller a binder representing the identity of the calling TextToSpeech object.
param
lang ISO-3 language code.
param
country ISO-3 country code. May be empty or null.
param
variant Language variant. May be empty or null.
return
Code indicating the support status for the locale. One of {@link TextToSpeech#LANG_AVAILABLE}, {@link TextToSpeech#LANG_COUNTRY_AVAILABLE}, {@link TextToSpeech#LANG_COUNTRY_VAR_AVAILABLE}, {@link TextToSpeech#LANG_MISSING_DATA} {@link TextToSpeech#LANG_NOT_SUPPORTED}.

public intloadVoice(android.os.IBinder caller, java.lang.String voiceName)
Notifies the engine that it should load a speech synthesis voice.

param
caller a binder representing the identity of the calling TextToSpeech object.
param
voiceName Unique voice of the name.
return
{@link TextToSpeech#SUCCESS} or {@link TextToSpeech#ERROR}.

public intplayAudio(android.os.IBinder callingInstance, android.net.Uri audioUri, int queueMode, android.os.Bundle params, java.lang.String utteranceId)
Plays an existing audio resource.

param
callingInstance a binder representing the identity of the calling TextToSpeech object.
param
audioUri URI for the audio resource (a file or android.resource URI)
param
queueMode Determines what to do to requests already in the queue.
param
utteranceId Unique identifier of synthesized utterance.
param
param Request parameters.

public intplaySilence(android.os.IBinder callingInstance, long duration, int queueMode, java.lang.String utteranceId)
Plays silence.

param
callingInstance a binder representing the identity of the calling TextToSpeech object.
param
duration Number of milliseconds of silence to play.
param
queueMode Determines what to do to requests already in the queue.
param
utteranceId Unique id used to identify this request in callbacks.

public voidsetCallback(android.os.IBinder caller, android.speech.tts.ITextToSpeechCallback cb)
Sets the callback that will be notified when playback of utterance from the given app are completed.

param
caller Instance a binder representing the identity of the calling TextToSpeech object.
param
cb The callback.

public intspeak(android.os.IBinder callingInstance, java.lang.CharSequence text, int queueMode, android.os.Bundle params, java.lang.String utteranceId)
Tells the engine to synthesize some speech and play it back.

param
callingInstance a binder representing the identity of the calling TextToSpeech object.
param
text The text to synthesize.
param
queueMode Determines what to do to requests already in the queue.
param
param Request parameters.
param
utteranceId Unique identifier of synthesized utterance.

public intstop(android.os.IBinder callingInstance)
Interrupts the current utterance (if from the given app) and removes any utterances in the queue that are from the given app.

param
callingInstance a binder representing the identity of the calling TextToSpeech object.

public intsynthesizeToFileDescriptor(android.os.IBinder callingInstance, java.lang.CharSequence text, android.os.ParcelFileDescriptor fileDescriptor, android.os.Bundle params, java.lang.String utteranceId)
Tells the engine to synthesize some speech and write it to a file.

param
callingInstance a binder representing the identity of the calling TextToSpeech object.
param
text The text to synthesize.
param
fileDescriptor The file descriptor to write the synthesized audio to. Has to be writable.
param
utteranceId Unique identifier of synthesized utterance.
param
param Request parameters.