Added in API level 14

SynthesisRequest


class SynthesisRequest
kotlin.Any
   ↳ android.speech.tts.SynthesisRequest

Contains data required by engines to synthesize speech. This data is:

  • The text to synthesize
  • The synthesis locale, represented as a language, country and a variant. The language is an ISO 639-3 letter language code, and the country is an ISO 3166 alpha 3 code. The variant is not specified.
  • The name of the voice requested for this synthesis. May be empty if the client uses TextToSpeech#setLanguage instead of TextToSpeech#setVoice
  • The synthesis speech rate, with 100 being the normal, and higher values representing higher speech rates.
  • The voice pitch, with 100 being the default pitch.
Any additional parameters sent to the text to speech service are passed in uninterpreted, see the params argument in android.speech.tts.TextToSpeech#speak and android.speech.tts.TextToSpeech#synthesizeToFile.

Summary

Public constructors
SynthesisRequest(text: String!, params: Bundle!)

Public methods
Int

Gets the request caller Uid.

CharSequence!

Gets the text which should be synthesized.

String!

Gets the ISO 3-letter country code for the language to use.

String!

Gets the ISO 3-letter language code for the language to use.

Bundle!

Gets the additional params, if any.

Int

Gets the pitch to use.

Int

Gets the speech rate to use.

String!

Gets the text which should be synthesized.

String!

Gets the language variant to use.

String!

Gets the name of the voice to use.

Public constructors

SynthesisRequest

Added in API level 14
SynthesisRequest(
    text: String!,
    params: Bundle!)

SynthesisRequest

Added in API level 21
SynthesisRequest(
    text: CharSequence!,
    params: Bundle!)

Public methods

getCallerUid

Added in API level 19
fun getCallerUid(): Int

Gets the request caller Uid.

getCharSequenceText

Added in API level 21
fun getCharSequenceText(): CharSequence!

Gets the text which should be synthesized.

getCountry

Added in API level 14
fun getCountry(): String!

Gets the ISO 3-letter country code for the language to use.

getLanguage

Added in API level 14
fun getLanguage(): String!

Gets the ISO 3-letter language code for the language to use.

getParams

Added in API level 14
fun getParams(): Bundle!

Gets the additional params, if any.

getPitch

Added in API level 14
fun getPitch(): Int

Gets the pitch to use. The normal pitch is 100.

getSpeechRate

Added in API level 14
fun getSpeechRate(): Int

Gets the speech rate to use. The normal rate is 100.

getText

Added in API level 14
Deprecated in API level 21
fun getText(): String!

Deprecated: As of API level 21, replaced by getCharSequenceText.

Gets the text which should be synthesized.

getVariant

Added in API level 14
fun getVariant(): String!

Gets the language variant to use.

getVoiceName

Added in API level 21
fun getVoiceName(): String!

Gets the name of the voice to use.