Class AudioSayEvent.Builder

Enclosing class:
AudioSayEvent

  • Method Details

    • text

      (REQUIRED) Text to be spoken.
      Parameters:
      text - The speech text.
      Returns:
      This builder.
    • style

      public AudioSayEvent.Builder style(int style)
      Text-to-speech voice style. See the Voice API documentation for valid options.
      Parameters:
      style - The TTS style as an int.
      Returns:
      This builder.
    • language

      Language for the spoken text.
      Parameters:
      language - The TTS language as an enum.
      Returns:
      This builder.
    • premium

      public AudioSayEvent.Builder premium(boolean premium)
      Whether to use the premium version of the text-to-speech voice.
      Parameters:
      premium - true to use Premium TTS.
      Returns:
      This builder.
    • ssml

      public AudioSayEvent.Builder ssml(boolean ssml)
      Whether to enable Synthesized Speech Markup Language (SSML).
      Parameters:
      ssml - true to use SSML.
      Returns:
      This builder.
    • build

      public AudioSayEvent build()
      Description copied from class: Event.Builder
      Builds the EventWithBody.
      Specified by:
      build in class Event.Builder<AudioSayEvent,AudioSayEvent.Builder>
      Returns:
      An instance of Event, populated with all fields from this builder.
    • queue

      public AudioSayEvent.Builder queue(boolean queue)
      Whether to queue the audio.
      Parameters:
      queue - true to enable queuing, false otherwise.
      Returns:
      This builder.
    • level

      public AudioSayEvent.Builder level(double level)
      Audio volume level, with -1 being quietest, +1 being loudest and 0 the default.
      Parameters:
      level - The volume as a double.
      Returns:
      This builder.
    • loop

      public AudioSayEvent.Builder loop(int loop)
      Number of times to repeat the audio. Default is 1.
      Parameters:
      loop - The loop count as an int.
      Returns:
      This builder.