AudioTranscriptionOptions Class
- java.
lang. Object - com.
azure. ai. openai. models. AudioTranscriptionOptions
- com.
public final class AudioTranscriptionOptions
The configuration information for an audio transcription request.
Constructor Summary
Constructor | Description |
---|---|
AudioTranscriptionOptions(byte[] file) |
Creates an instance of Audio |
Method Summary
Modifier and Type | Method and Description |
---|---|
byte[] |
getFile()
Get the file property: The audio data to transcribe. |
String |
getFilename()
Get the filename property: The optional filename or descriptive identifier to associate with with the audio data. |
String |
getLanguage()
Get the language property: The primary spoken language of the audio data to be transcribed, supplied as a two-letter ISO-639-1 language code such as 'en' or 'fr'. |
String |
getModel()
Get the model property: The model to use for this transcription request. |
String |
getPrompt()
Get the prompt property: An optional hint to guide the model's style or continue from a prior audio segment. |
Audio |
getResponseFormat()
Get the response |
Double |
getTemperature()
Get the temperature property: The sampling temperature, between 0 and 1. |
List<Audio |
getTimestampGranularities()
Get the timestamp |
Audio |
setFilename(String filename)
Set the filename property: The optional filename or descriptive identifier to associate with with the audio data. |
Audio |
setLanguage(String language)
Set the language property: The primary spoken language of the audio data to be transcribed, supplied as a two-letter ISO-639-1 language code such as 'en' or 'fr'. |
Audio |
setModel(String model)
Set the model property: The model to use for this transcription request. |
Audio |
setPrompt(String prompt)
Set the prompt property: An optional hint to guide the model's style or continue from a prior audio segment. |
Audio |
setResponseFormat(AudioTranscriptionFormat responseFormat)
Set the response |
Audio |
setTemperature(Double temperature)
Set the temperature property: The sampling temperature, between 0 and 1. |
Audio |
setTimestampGranularities(List<AudioTranscriptionTimestampGranularity> timestampGranularities)
Set the timestamp |
Methods inherited from java.lang.Object
Constructor Details
AudioTranscriptionOptions
public AudioTranscriptionOptions(byte[] file)
Creates an instance of AudioTranscriptionOptions class.
Parameters:
Method Details
getFile
public byte[] getFile()
Get the file property: The audio data to transcribe. This must be the binary content of a file in one of the supported media formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, webm.
Returns:
getFilename
public String getFilename()
Get the filename property: The optional filename or descriptive identifier to associate with with the audio data.
Returns:
getLanguage
public String getLanguage()
Get the language property: The primary spoken language of the audio data to be transcribed, supplied as a two-letter ISO-639-1 language code such as 'en' or 'fr'. Providing this known input language is optional but may improve the accuracy and/or latency of transcription.
Returns:
getModel
public String getModel()
Get the model property: The model to use for this transcription request.
Returns:
getPrompt
public String getPrompt()
Get the prompt property: An optional hint to guide the model's style or continue from a prior audio segment. The written language of the prompt should match the primary spoken language of the audio data.
Returns:
getResponseFormat
public AudioTranscriptionFormat getResponseFormat()
Get the responseFormat property: The requested format of the transcription response data, which will influence the content and detail of the result.
Returns:
getTemperature
public Double getTemperature()
Get the temperature property: The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use log probability to automatically increase the temperature until certain thresholds are hit.
Returns:
getTimestampGranularities
public List
Get the timestampGranularities property: The timestamp granularities to populate for this transcription. `response_format` must be set `verbose_json` to use timestamp granularities. Either or both of these options are supported: `word`, or `segment`. Note: There is no additional latency for segment timestamps, but generating word timestamps incurs additional latency.
Returns:
setFilename
public AudioTranscriptionOptions setFilename(String filename)
Set the filename property: The optional filename or descriptive identifier to associate with with the audio data.
Parameters:
Returns:
setLanguage
public AudioTranscriptionOptions setLanguage(String language)
Set the language property: The primary spoken language of the audio data to be transcribed, supplied as a two-letter ISO-639-1 language code such as 'en' or 'fr'. Providing this known input language is optional but may improve the accuracy and/or latency of transcription.
Parameters:
Returns:
setModel
public AudioTranscriptionOptions setModel(String model)
Set the model property: The model to use for this transcription request.
Parameters:
Returns:
setPrompt
public AudioTranscriptionOptions setPrompt(String prompt)
Set the prompt property: An optional hint to guide the model's style or continue from a prior audio segment. The written language of the prompt should match the primary spoken language of the audio data.
Parameters:
Returns:
setResponseFormat
public AudioTranscriptionOptions setResponseFormat(AudioTranscriptionFormat responseFormat)
Set the responseFormat property: The requested format of the transcription response data, which will influence the content and detail of the result.
Parameters:
Returns:
setTemperature
public AudioTranscriptionOptions setTemperature(Double temperature)
Set the temperature property: The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use log probability to automatically increase the temperature until certain thresholds are hit.
Parameters:
Returns:
setTimestampGranularities
public AudioTranscriptionOptions setTimestampGranularities(List
Set the timestampGranularities property: The timestamp granularities to populate for this transcription. `response_format` must be set `verbose_json` to use timestamp granularities. Either or both of these options are supported: `word`, or `segment`. Note: There is no additional latency for segment timestamps, but generating word timestamps incurs additional latency.
Parameters:
Returns:
Applies to
Azure SDK for Java