Delen via


AudioTranslation Class

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

Implements

public final class AudioTranslation
implements JsonSerializable<AudioTranslation>

Result information for an operation that translated spoken audio into written text.

Method Summary

Modifier and Type Method and Description
static AudioTranslation fromJson(JsonReader jsonReader)

Reads an instance of AudioTranslation from the JsonReader.

Duration getDuration()

Get the duration property: The total duration of the audio processed to produce accompanying translation information.

String getLanguage()

Get the language property: The spoken language that was detected in the translated audio data.

List<AudioTranslationSegment> getSegments()

Get the segments property: A collection of information about the timing, probabilities, and other detail of each processed audio segment.

AudioTaskLabel getTask()

Get the task property: The label that describes which operation type generated the accompanying response data.

String getText()

Get the text property: The translated text for the provided audio data.

JsonWriter toJson(JsonWriter jsonWriter)

Methods inherited from java.lang.Object

Method Details

fromJson

public static AudioTranslation fromJson(JsonReader jsonReader)

Reads an instance of AudioTranslation from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of AudioTranslation 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.

getDuration

public Duration getDuration()

Get the duration property: The total duration of the audio processed to produce accompanying translation information.

Returns:

the duration value.

getLanguage

public String getLanguage()

Get the language property: The spoken language that was detected in the translated audio data. This is expressed as a two-letter ISO-639-1 language code like 'en' or 'fr'.

Returns:

the language value.

getSegments

public List getSegments()

Get the segments property: A collection of information about the timing, probabilities, and other detail of each processed audio segment.

Returns:

the segments value.

getTask

public AudioTaskLabel getTask()

Get the task property: The label that describes which operation type generated the accompanying response data.

Returns:

the task value.

getText

public String getText()

Get the text property: The translated text for the provided audio data.

Returns:

the text value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

Applies to