Class AudioMetadata

java.lang.Object
com.google.genai.JsonSerializable
com.google.genai.types.AudioMetadata

public abstract class AudioMetadata extends JsonSerializable
Metadata describes the input audio content.

Set this in `Part.audio_metadata` or `FunctionResponsePart.audio_metadata` when `inline_data` or `file_data` contains audio to configure static audio preprocessing.

  • Constructor Details

    • AudioMetadata

      public AudioMetadata()
  • Method Details

    • startOffset

      public abstract Optional<Duration> startOffset()
      Optional. The start offset of the audio, relative to the start of the audio stream.
    • endOffset

      public abstract Optional<Duration> endOffset()
      Optional. The end offset of the audio, relative to the start of the audio stream.
    • builder

      public static AudioMetadata.Builder builder()
      Instantiates a builder for AudioMetadata.
    • toBuilder

      public abstract AudioMetadata.Builder toBuilder()
      Creates a builder with the same values as this instance.
    • fromJson

      public static AudioMetadata fromJson(String jsonString)
      Deserializes a JSON string to a AudioMetadata object.