Package com.azure.ai.openai.models
Class AudioTranslation
java.lang.Object
com.azure.ai.openai.models.AudioTranslation
- All Implemented Interfaces:
com.azure.json.JsonSerializable<AudioTranslation>
public final class AudioTranslation
extends Object
implements com.azure.json.JsonSerializable<AudioTranslation>
Result information for an operation that translated spoken audio into written text.
-
Method Summary
Modifier and TypeMethodDescriptionstatic AudioTranslationfromJson(com.azure.json.JsonReader jsonReader) Reads an instance of AudioTranslation from the JsonReader.Get the duration property: The total duration of the audio processed to produce accompanying translation information.Get the language property: The spoken language that was detected in the translated audio data.Get the segments property: A collection of information about the timing, probabilities, and other detail of each processed audio segment.getTask()Get the task property: The label that describes which operation type generated the accompanying response data.getText()Get the text property: The translated text for the provided audio data.com.azure.json.JsonWritertoJson(com.azure.json.JsonWriter jsonWriter)
-
Method Details
-
getText
Get the text property: The translated text for the provided audio data.- Returns:
- the text value.
-
getTask
Get the task property: The label that describes which operation type generated the accompanying response data.- Returns:
- the task value.
-
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.
-
getDuration
Get the duration property: The total duration of the audio processed to produce accompanying translation information.- Returns:
- the duration value.
-
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.
-
toJson
- Specified by:
toJsonin interfacecom.azure.json.JsonSerializable<AudioTranslation>- Throws:
IOException
-
fromJson
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:
IllegalStateException- If the deserialized JSON object was missing any required properties.IOException- If an error occurs while reading the AudioTranslation.
-