Class AudioTranslationSegment

java.lang.Object
com.azure.ai.openai.models.AudioTranslationSegment
All Implemented Interfaces:
com.azure.json.JsonSerializable<AudioTranslationSegment>

public final class AudioTranslationSegment extends Object implements com.azure.json.JsonSerializable<AudioTranslationSegment>
Extended information about a single segment of translated audio data. Segments generally represent roughly 5-10 seconds of speech. Segment boundaries typically occur between words but not necessarily sentences.
  • Method Summary

    Modifier and Type
    Method
    Description
    fromJson(com.azure.json.JsonReader jsonReader)
    Reads an instance of AudioTranslationSegment from the JsonReader.
    double
    Get the avgLogprob property: The average log probability associated with this audio segment.
    double
    Get the compressionRatio property: The compression ratio of this audio segment.
    Get the end property: The time at which this segment ended relative to the beginning of the translated audio.
    int
    Get the id property: The 0-based index of this segment within a translation.
    double
    Get the noSpeechProb property: The probability of no speech detection within this audio segment.
    int
    Get the seek property: The seek position associated with the processing of this audio segment.
    Get the start property: The time at which this segment started relative to the beginning of the translated audio.
    double
    Get the temperature property: The temperature score associated with this audio segment.
    Get the text property: The translated text that was part of this audio segment.
    Get the tokens property: The token IDs matching the translated text in this audio segment.
    com.azure.json.JsonWriter
    toJson(com.azure.json.JsonWriter jsonWriter)

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface com.azure.json.JsonSerializable

    toJson, toJson, toJsonBytes, toJsonString
  • Method Details

    • getId

      public int getId()
      Get the id property: The 0-based index of this segment within a translation.
      Returns:
      the id value.
    • getStart

      public Duration getStart()
      Get the start property: The time at which this segment started relative to the beginning of the translated audio.
      Returns:
      the start value.
    • getEnd

      public Duration getEnd()
      Get the end property: The time at which this segment ended relative to the beginning of the translated audio.
      Returns:
      the end value.
    • getText

      public String getText()
      Get the text property: The translated text that was part of this audio segment.
      Returns:
      the text value.
    • getTemperature

      public double getTemperature()
      Get the temperature property: The temperature score associated with this audio segment.
      Returns:
      the temperature value.
    • getAvgLogprob

      public double getAvgLogprob()
      Get the avgLogprob property: The average log probability associated with this audio segment.
      Returns:
      the avgLogprob value.
    • getCompressionRatio

      public double getCompressionRatio()
      Get the compressionRatio property: The compression ratio of this audio segment.
      Returns:
      the compressionRatio value.
    • getNoSpeechProb

      public double getNoSpeechProb()
      Get the noSpeechProb property: The probability of no speech detection within this audio segment.
      Returns:
      the noSpeechProb value.
    • getTokens

      public List<Integer> getTokens()
      Get the tokens property: The token IDs matching the translated text in this audio segment.
      Returns:
      the tokens value.
    • getSeek

      public int getSeek()
      Get the seek property: The seek position associated with the processing of this audio segment. Seek positions are expressed as hundredths of seconds. The model may process several segments from a single seek position, so while the seek position will never represent a later time than the segment's start, the segment's start may represent a significantly later time than the segment's associated seek position.
      Returns:
      the seek value.
    • toJson

      public com.azure.json.JsonWriter toJson(com.azure.json.JsonWriter jsonWriter) throws IOException
      Specified by:
      toJson in interface com.azure.json.JsonSerializable<AudioTranslationSegment>
      Throws:
      IOException
    • fromJson

      public static AudioTranslationSegment fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads an instance of AudioTranslationSegment from the JsonReader.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of AudioTranslationSegment if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
      Throws:
      IllegalStateException - If the deserialized JSON object was missing any required properties.
      IOException - If an error occurs while reading the AudioTranslationSegment.