Class AudioTranscriptionSegment

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

public final class AudioTranscriptionSegment extends Object implements com.azure.json.JsonSerializable<AudioTranscriptionSegment>
Extended information about a single segment of transcribed 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 AudioTranscriptionSegment 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 transcribed audio.
    int
    Get the id property: The 0-based index of this segment within a transcription.
    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 transcribed audio.
    double
    Get the temperature property: The temperature score associated with this audio segment.
    Get the text property: The transcribed text that was part of this audio segment.
    Get the tokens property: The token IDs matching the transcribed 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
  • Method Details

    • getId

      public int getId()
      Get the id property: The 0-based index of this segment within a transcription.
      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 transcribed 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 transcribed audio.
      Returns:
      the end value.
    • getText

      public String getText()
      Get the text property: The transcribed 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 transcribed 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<AudioTranscriptionSegment>
      Throws:
      IOException
    • fromJson

      public static AudioTranscriptionSegment fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads an instance of AudioTranscriptionSegment from the JsonReader.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of AudioTranscriptionSegment 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 AudioTranscriptionSegment.