AudioTranslationSegment Class

  • java.lang.Object
    • com.azure.ai.openai.models.AudioTranslationSegment

Implements

public final class AudioTranslationSegment
implements 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 and Description
static AudioTranslationSegment fromJson(JsonReader jsonReader)

Reads an instance of AudioTranslationSegment from the JsonReader.

double getAvgLogprob()

Get the avgLogprob property: The average log probability associated with this audio segment.

double getCompressionRatio()

Get the compressionRatio property: The compression ratio of this audio segment.

Duration getEnd()

Get the end property: The time at which this segment ended relative to the beginning of the translated audio.

int getId()

Get the id property: The 0-based index of this segment within a translation.

double getNoSpeechProb()

Get the noSpeechProb property: The probability of no speech detection within this audio segment.

int getSeek()

Get the seek property: The seek position associated with the processing of this audio segment.

Duration getStart()

Get the start property: The time at which this segment started relative to the beginning of the translated audio.

double getTemperature()

Get the temperature property: The temperature score associated with this audio segment.

String getText()

Get the text property: The translated text that was part of this audio segment.

List<Integer> getTokens()

Get the tokens property: The token IDs matching the translated text in this audio segment.

JsonWriter toJson(JsonWriter jsonWriter)

Methods inherited from java.lang.Object

Method Details

fromJson

public static AudioTranslationSegment fromJson(JsonReader jsonReader)

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:

IOException

- If the deserialized JSON object was missing any required properties.

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.

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.

getId

public int getId()

Get the id property: The 0-based index of this segment within a translation.

Returns:

the id value.

getNoSpeechProb

public double getNoSpeechProb()

Get the noSpeechProb property: The probability of no speech detection within this audio segment.

Returns:

the noSpeechProb 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.

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.

getTemperature

public double getTemperature()

Get the temperature property: The temperature score associated with this audio segment.

Returns:

the temperature value.

getText

public String getText()

Get the text property: The translated text that was part of this audio segment.

Returns:

the text value.

getTokens

public List getTokens()

Get the tokens property: The token IDs matching the translated text in this audio segment.

Returns:

the tokens value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

Applies to