Class VoiceOutput

java.lang.Object
com.google.genai.gaos.models.voices.VoiceOutput

public class VoiceOutput extends Object
VoiceOutput

A voice resource representing either a custom voice (created via `CreateVoice`) or a prebuilt system voice (returned by `ListVoices`).

  • Constructor Details

  • Method Details

    • accent

      public Optional<String> accent()
      Optional. Regional accent descriptor (e.g. "American", "British").
    • context

      public Optional<String> context()
      Optional. Optimal usage context or domain (e.g. "Conversational", "Audiobook", "News").
    • description

      public Optional<String> description()
      Optional. Descriptive summary of vocal timbre, personality, and tone.
    • displayName

      public Optional<String> displayName()
      Optional. User-provided display name for a stored voice (`store = true`), or the catalog name for a prebuilt voice.
    • expireTime

      public Optional<OffsetDateTime> expireTime()
      Output only. The timestamp at which a custom stored voice (`store = true`) or replicated voice key (`store = false`) expires. For custom stored voices (`store = true`), this expiration time is extended when the voice is used for speech synthesis or as a `base_voice` in `CreateVoice`. Unset for prebuilt catalog voices (`"prebuilt"`), which do not expire.
    • gender

      public Optional<String> gender()
      Optional. Perceived voice gender presentation (e.g. "female", "male", "neutral").
    • id

      public Optional<String> id()
      Output only. The unique identifier of the voice.

      * For Google-managed custom voices (`store = true`), this is a generated ID with prefix `voice_` (for example, `voice_abc123def456`). Pass `voices/{id}` as the `name` in `GetVoice` and `DeleteVoice`, and pass `{id}` directly to `SpeechConfig.voice_config.voice` (or `SpeechConfig.voice`) during speech synthesis. * For prebuilt catalog voices (`"prebuilt"` returned by `ListVoices`), this is the speaker name (for example, `Puck` or `Charon`). * Unset when `CreateVoice` is called with `store = false`.

    • key

      public Optional<String> key()
      Output only. The client-managed voice replication key (with prefix `voicekey_`). Returned only by `CreateVoice` when `type` is `"replicated"` and `store` is `false`. Pass this key to `SpeechConfig.voice_config.voice` (or `SpeechConfig.voice`) during speech synthesis.
    • languageCode

      public Optional<String> languageCode()
      Optional. Primary BCP-47 language tag (e.g. "en-US", "fr-FR").
    • model

      public Optional<String> model()
      Optional. The model used to design or replicate the voice. If omitted in `CreateVoice`, defaults to the latest supported voice design model. Returned in `CreateVoice`, `GetVoice`, and `ListVoices` responses for custom voices (`"prompted"` and `"replicated"`); unset for `"prebuilt"` voices. Created voices can be synthesized across any supported TTS synthesis model.
    • persona

      public Optional<String> persona()
      Optional. Intended persona or character archetype (e.g. "Warm, Friendly", "Narrator").
    • pitch

      public Optional<Pitch> pitch()
    • prompted

      public Optional<PromptedVoice> prompted()
      Parameters for prompted voice generation. Required in `CreateVoice` when `type` is `"prompted"`. Returned in `CreateVoice`, `GetVoice`, and `ListVoices` responses for prompted voices.
    • regionCode

      public Optional<String> regionCode()
      Optional. ISO 3166-1 alpha-2 or UN M.49 geographic region code (e.g. "US", "GB", "001").
    • sampleAudio

      public Optional<AudioData> sampleAudio()
      Audio payload used for voice creation.
    • type

      public Optional<VoiceType> type()
    • usage

      public Optional<Usage> usage()
      Statistics on the interaction request's token usage.
    • builder

      public static VoiceOutput.Builder builder()
    • withAccent

      public VoiceOutput withAccent(@Nullable String accent)
      Optional. Regional accent descriptor (e.g. "American", "British").
    • withContext

      public VoiceOutput withContext(@Nullable String context)
      Optional. Optimal usage context or domain (e.g. "Conversational", "Audiobook", "News").
    • withDescription

      public VoiceOutput withDescription(@Nullable String description)
      Optional. Descriptive summary of vocal timbre, personality, and tone.
    • withDisplayName

      public VoiceOutput withDisplayName(@Nullable String displayName)
      Optional. User-provided display name for a stored voice (`store = true`), or the catalog name for a prebuilt voice.
    • withExpireTime

      public VoiceOutput withExpireTime(@Nullable OffsetDateTime expireTime)
      Output only. The timestamp at which a custom stored voice (`store = true`) or replicated voice key (`store = false`) expires. For custom stored voices (`store = true`), this expiration time is extended when the voice is used for speech synthesis or as a `base_voice` in `CreateVoice`. Unset for prebuilt catalog voices (`"prebuilt"`), which do not expire.
    • withGender

      public VoiceOutput withGender(@Nullable String gender)
      Optional. Perceived voice gender presentation (e.g. "female", "male", "neutral").
    • withId

      public VoiceOutput withId(@Nullable String id)
      Output only. The unique identifier of the voice.

      * For Google-managed custom voices (`store = true`), this is a generated ID with prefix `voice_` (for example, `voice_abc123def456`). Pass `voices/{id}` as the `name` in `GetVoice` and `DeleteVoice`, and pass `{id}` directly to `SpeechConfig.voice_config.voice` (or `SpeechConfig.voice`) during speech synthesis. * For prebuilt catalog voices (`"prebuilt"` returned by `ListVoices`), this is the speaker name (for example, `Puck` or `Charon`). * Unset when `CreateVoice` is called with `store = false`.

    • withKey

      public VoiceOutput withKey(@Nullable String key)
      Output only. The client-managed voice replication key (with prefix `voicekey_`). Returned only by `CreateVoice` when `type` is `"replicated"` and `store` is `false`. Pass this key to `SpeechConfig.voice_config.voice` (or `SpeechConfig.voice`) during speech synthesis.
    • withLanguageCode

      public VoiceOutput withLanguageCode(@Nullable String languageCode)
      Optional. Primary BCP-47 language tag (e.g. "en-US", "fr-FR").
    • withModel

      public VoiceOutput withModel(@Nullable String model)
      Optional. The model used to design or replicate the voice. If omitted in `CreateVoice`, defaults to the latest supported voice design model. Returned in `CreateVoice`, `GetVoice`, and `ListVoices` responses for custom voices (`"prompted"` and `"replicated"`); unset for `"prebuilt"` voices. Created voices can be synthesized across any supported TTS synthesis model.
    • withPersona

      public VoiceOutput withPersona(@Nullable String persona)
      Optional. Intended persona or character archetype (e.g. "Warm, Friendly", "Narrator").
    • withPitch

      public VoiceOutput withPitch(@Nullable Pitch pitch)
    • withPrompted

      public VoiceOutput withPrompted(@Nullable PromptedVoice prompted)
      Parameters for prompted voice generation. Required in `CreateVoice` when `type` is `"prompted"`. Returned in `CreateVoice`, `GetVoice`, and `ListVoices` responses for prompted voices.
    • withRegionCode

      public VoiceOutput withRegionCode(@Nullable String regionCode)
      Optional. ISO 3166-1 alpha-2 or UN M.49 geographic region code (e.g. "US", "GB", "001").
    • withSampleAudio

      public VoiceOutput withSampleAudio(@Nullable AudioData sampleAudio)
      Audio payload used for voice creation.
    • withType

      public VoiceOutput withType(@Nonnull VoiceType type)
    • withUsage

      public VoiceOutput withUsage(@Nullable Usage usage)
      Statistics on the interaction request's token usage.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object