Class Voice

java.lang.Object
software.amazon.awssdk.services.polly.model.Voice
All Implemented Interfaces:
Serializable, SdkPojo, ToCopyableBuilder<Voice.Builder,Voice>

@Generated("software.amazon.awssdk:codegen") public final class Voice extends Object implements SdkPojo, Serializable, ToCopyableBuilder<Voice.Builder,Voice>

Describes a voice. Amazon Polly provides voices, and you can create custom voices with CreateVoice. Origin indicates whether Amazon Polly provides the voice or you created it. DescribeVoices returns a subset of the fields for each voice. GetVoice returns all fields of a custom voice.

See Also:
  • Method Details

    • arn

      public final String arn()

      The Amazon Resource Name (ARN) of a custom voice, in the form arn:partition:polly:region:account-id:voice/voice-id. CreateVoice and GetVoice return this field. Voices that Amazon Polly provides don't have an ARN.

      Returns:
      The Amazon Resource Name (ARN) of a custom voice, in the form arn:partition:polly:region:account-id:voice/voice-id. CreateVoice and GetVoice return this field. Voices that Amazon Polly provides don't have an ARN.
    • gender

      public final Gender gender()

      The gender of the voice. Custom voices don't include this field.

      If the service returns an enum value that is not available in the current SDK version, gender will return Gender.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from genderAsString().

      Returns:
      The gender of the voice. Custom voices don't include this field.
      See Also:
    • genderAsString

      public final String genderAsString()

      The gender of the voice. Custom voices don't include this field.

      If the service returns an enum value that is not available in the current SDK version, gender will return Gender.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from genderAsString().

      Returns:
      The gender of the voice. Custom voices don't include this field.
      See Also:
    • id

      public final VoiceId id()

      The voice ID that Amazon Polly assigns. You specify this ID when you call the SynthesizeSpeech operation. For a custom voice, Amazon Polly assigns an ID that consists of vc- followed by hexadecimal characters, for example, vc-9a8fa85dd3.

      If the service returns an enum value that is not available in the current SDK version, id will return VoiceId.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from idAsString().

      Returns:
      The voice ID that Amazon Polly assigns. You specify this ID when you call the SynthesizeSpeech operation. For a custom voice, Amazon Polly assigns an ID that consists of vc- followed by hexadecimal characters, for example, vc-9a8fa85dd3.
      See Also:
    • idAsString

      public final String idAsString()

      The voice ID that Amazon Polly assigns. You specify this ID when you call the SynthesizeSpeech operation. For a custom voice, Amazon Polly assigns an ID that consists of vc- followed by hexadecimal characters, for example, vc-9a8fa85dd3.

      If the service returns an enum value that is not available in the current SDK version, id will return VoiceId.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from idAsString().

      Returns:
      The voice ID that Amazon Polly assigns. You specify this ID when you call the SynthesizeSpeech operation. For a custom voice, Amazon Polly assigns an ID that consists of vc- followed by hexadecimal characters, for example, vc-9a8fa85dd3.
      See Also:
    • languageCode

      public final LanguageCode languageCode()

      Language code of the voice.

      If the service returns an enum value that is not available in the current SDK version, languageCode will return LanguageCode.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from languageCodeAsString().

      Returns:
      Language code of the voice.
      See Also:
    • languageCodeAsString

      public final String languageCodeAsString()

      Language code of the voice.

      If the service returns an enum value that is not available in the current SDK version, languageCode will return LanguageCode.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from languageCodeAsString().

      Returns:
      Language code of the voice.
      See Also:
    • languageName

      public final String languageName()

      Human readable name of the language in English.

      Returns:
      Human readable name of the language in English.
    • name

      public final String name()

      The name of the voice, for example, Salli or Kendra. The name is human-readable, and you might display it in your application. For a custom voice, this is the Name that you specified in CreateVoice.

      Returns:
      The name of the voice, for example, Salli or Kendra. The name is human-readable, and you might display it in your application. For a custom voice, this is the Name that you specified in CreateVoice.
    • origin

      public final VoiceOrigin origin()

      Indicates who provides the voice. The origin is one of the following:

      aws

      A voice that Amazon Polly provides.

      customer

      A custom voice that you created with CreateVoice.

      If the service returns an enum value that is not available in the current SDK version, origin will return VoiceOrigin.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from originAsString().

      Returns:
      Indicates who provides the voice. The origin is one of the following:

      aws

      A voice that Amazon Polly provides.

      customer

      A custom voice that you created with CreateVoice.

      See Also:
    • originAsString

      public final String originAsString()

      Indicates who provides the voice. The origin is one of the following:

      aws

      A voice that Amazon Polly provides.

      customer

      A custom voice that you created with CreateVoice.

      If the service returns an enum value that is not available in the current SDK version, origin will return VoiceOrigin.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from originAsString().

      Returns:
      Indicates who provides the voice. The origin is one of the following:

      aws

      A voice that Amazon Polly provides.

      customer

      A custom voice that you created with CreateVoice.

      See Also:
    • status

      public final VoiceStatus status()

      The status of a custom voice. Voices that Amazon Polly provides don't include this field. The status is one of the following:

      pending

      Amazon Polly is creating the voice.

      active

      The voice is ready for speech synthesis.

      failed

      Amazon Polly couldn't create the voice. StatusReason describes why.

      If the service returns an enum value that is not available in the current SDK version, status will return VoiceStatus.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from statusAsString().

      Returns:
      The status of a custom voice. Voices that Amazon Polly provides don't include this field. The status is one of the following:

      pending

      Amazon Polly is creating the voice.

      active

      The voice is ready for speech synthesis.

      failed

      Amazon Polly couldn't create the voice. StatusReason describes why.

      See Also:
    • statusAsString

      public final String statusAsString()

      The status of a custom voice. Voices that Amazon Polly provides don't include this field. The status is one of the following:

      pending

      Amazon Polly is creating the voice.

      active

      The voice is ready for speech synthesis.

      failed

      Amazon Polly couldn't create the voice. StatusReason describes why.

      If the service returns an enum value that is not available in the current SDK version, status will return VoiceStatus.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from statusAsString().

      Returns:
      The status of a custom voice. Voices that Amazon Polly provides don't include this field. The status is one of the following:

      pending

      Amazon Polly is creating the voice.

      active

      The voice is ready for speech synthesis.

      failed

      Amazon Polly couldn't create the voice. StatusReason describes why.

      See Also:
    • statusReason

      public final String statusReason()

      Additional information about the status of a custom voice. When the status is failed, this field describes why Amazon Polly couldn't create the voice.

      Returns:
      Additional information about the status of a custom voice. When the status is failed, this field describes why Amazon Polly couldn't create the voice.
    • additionalLanguageCodes

      public final List<LanguageCode> additionalLanguageCodes()

      Additional codes for languages available for the specified voice in addition to its default language.

      For example, the default language for Aditi is Indian English (en-IN) because it was first used for that language. Since Aditi is bilingual and fluent in both Indian English and Hindi, this parameter would show the code hi-IN.

      Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.

      This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the hasAdditionalLanguageCodes() method.

      Returns:
      Additional codes for languages available for the specified voice in addition to its default language.

      For example, the default language for Aditi is Indian English (en-IN) because it was first used for that language. Since Aditi is bilingual and fluent in both Indian English and Hindi, this parameter would show the code hi-IN.

    • hasAdditionalLanguageCodes

      public final boolean hasAdditionalLanguageCodes()
      For responses, this returns true if the service returned a value for the AdditionalLanguageCodes property. This DOES NOT check that the value is non-empty (for which, you should check the isEmpty() method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
    • additionalLanguageCodesAsStrings

      public final List<String> additionalLanguageCodesAsStrings()

      Additional codes for languages available for the specified voice in addition to its default language.

      For example, the default language for Aditi is Indian English (en-IN) because it was first used for that language. Since Aditi is bilingual and fluent in both Indian English and Hindi, this parameter would show the code hi-IN.

      Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.

      This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the hasAdditionalLanguageCodes() method.

      Returns:
      Additional codes for languages available for the specified voice in addition to its default language.

      For example, the default language for Aditi is Indian English (en-IN) because it was first used for that language. Since Aditi is bilingual and fluent in both Indian English and Hindi, this parameter would show the code hi-IN.

    • supportedEngines

      public final List<Engine> supportedEngines()

      Specifies which engines (standard, neural, long-form or generative) are supported by a given voice.

      Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.

      This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the hasSupportedEngines() method.

      Returns:
      Specifies which engines (standard, neural, long-form or generative) are supported by a given voice.
    • hasSupportedEngines

      public final boolean hasSupportedEngines()
      For responses, this returns true if the service returned a value for the SupportedEngines property. This DOES NOT check that the value is non-empty (for which, you should check the isEmpty() method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
    • supportedEnginesAsStrings

      public final List<String> supportedEnginesAsStrings()

      Specifies which engines (standard, neural, long-form or generative) are supported by a given voice.

      Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.

      This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the hasSupportedEngines() method.

      Returns:
      Specifies which engines (standard, neural, long-form or generative) are supported by a given voice.
    • voiceCreationData

      public final VoiceCreationData voiceCreationData()

      The data from which you created the custom voice. CreateVoice and GetVoice return this field. The response doesn't include the audio: a recording that Amazon Polly read from Amazon S3 includes its S3Url, and a recording that you passed as Bytes has no fields in Data.

      Returns:
      The data from which you created the custom voice. CreateVoice and GetVoice return this field. The response doesn't include the audio: a recording that Amazon Polly read from Amazon S3 includes its S3Url, and a recording that you passed as Bytes has no fields in Data.
    • customerManagedEncryption

      public final CustomerManagedEncryption customerManagedEncryption()

      The customer managed key that encrypts your custom voice. CreateVoice and GetVoice return this field if you specified a key in CreateVoice.

      Returns:
      The customer managed key that encrypts your custom voice. CreateVoice and GetVoice return this field if you specified a key in CreateVoice.
    • creationTime

      public final Instant creationTime()

      The date and time when you created the custom voice. Voices that Amazon Polly provides don't include this field.

      Returns:
      The date and time when you created the custom voice. Voices that Amazon Polly provides don't include this field.
    • toBuilder

      public Voice.Builder toBuilder()
      Description copied from interface: ToCopyableBuilder
      Take this object and create a builder that contains all of the current property values of this object.
      Specified by:
      toBuilder in interface ToCopyableBuilder<Voice.Builder,Voice>
      Returns:
      a builder for type T
    • builder

      public static Voice.Builder builder()
    • serializableBuilderClass

      public static Class<? extends Voice.Builder> serializableBuilderClass()
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public final boolean equals(Object obj)
      Overrides:
      equals in class Object
    • equalsBySdkFields

      public final boolean equalsBySdkFields(Object obj)
      Description copied from interface: SdkPojo
      Indicates whether some other object is "equal to" this one by SDK fields. An SDK field is a modeled, non-inherited field in an SdkPojo class, and is generated based on a service model.

      If an SdkPojo class does not have any inherited fields, equalsBySdkFields and equals are essentially the same.

      Specified by:
      equalsBySdkFields in interface SdkPojo
      Parameters:
      obj - the object to be compared with
      Returns:
      true if the other object equals to this object by sdk fields, false otherwise.
    • toString

      public final String toString()
      Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be redacted from this string using a placeholder value.
      Overrides:
      toString in class Object
    • getValueForField

      public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz)
    • sdkFields

      public final List<SdkField<?>> sdkFields()
      Specified by:
      sdkFields in interface SdkPojo
      Returns:
      List of SdkField in this POJO. May be empty list but should never be null.
    • sdkFieldNameToField

      public final Map<String,SdkField<?>> sdkFieldNameToField()
      Specified by:
      sdkFieldNameToField in interface SdkPojo
      Returns:
      The mapping between the field name and its corresponding field.