# Class TtsOptions

java.lang.Object
com.codename1.media.TtsOptions

public final class TtsOptions extends Object
Tuning knobs for `TextToSpeech.speak(String, TtsOptions)`.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `TtsOptions()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `getLanguageTag()`
  `float`
  `getPitch()`
  `float`
  `getRate()`
  `String`
  `getVoiceId()`
  `float`
  `getVolume()`
  `TtsOptions`
  `setLanguageTag(String tag)`
  BCP-47 language tag (`"en-US"`, `"ja-JP"` etc.).
  `TtsOptions`
  `setPitch(float p)`
  Pitch multiplier.
  `TtsOptions`
  `setRate(float r)`
  Speaking rate.
  `TtsOptions`
  `setVoiceId(String id)`
  Platform-specific voice identifier obtained from `TextToSpeech.getAvailableVoices()`.
  `TtsOptions`
  `setVolume(float v)`
  Output volume in `[0.0, 1.0]`.

  ### Methods inherited from class Object

  `clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### TtsOptions

    public TtsOptions()

- ## Method Details

  - ### setLanguageTag

    public TtsOptions setLanguageTag(String tag)
    BCP-47 language tag (`"en-US"`, `"ja-JP"` etc.). When null, the device's default voice is used.

  - ### getLanguageTag

    public String getLanguageTag()

  - ### setVoiceId

    public TtsOptions setVoiceId(String id)
    Platform-specific voice identifier obtained from `TextToSpeech.getAvailableVoices()`. When null the default voice for the language tag is used.

  - ### getVoiceId

    public String getVoiceId()

  - ### setRate

    public TtsOptions setRate(float r)
    Speaking rate. `1.0` is the platform default; `0.5` is half speed; `2.0` is double. Clamped per-platform.

  - ### getRate

    public float getRate()

  - ### setPitch

    public TtsOptions setPitch(float p)
    Pitch multiplier. `1.0` is the platform default. Clamped per-platform.

  - ### getPitch

    public float getPitch()

  - ### setVolume

    public TtsOptions setVolume(float v)
    Output volume in `[0.0, 1.0]`.

  - ### getVolume

    public float getVolume()