Class TranscriptionRequest
java.lang.Object
com.codename1.media.TranscriptionRequest
File transcription request shared by transcription providers.
-
Constructor Summary
ConstructorsConstructorDescriptionTranscriptionRequest(String audioPath) Creates a file-based transcription request. -
Method Summary
Modifier and TypeMethodDescriptionstatic TranscriptionRequestCreates a file-based transcription request.Gets the audio file path.Gets the requested recognition language.Gets a provider-specific option value.Gets all provider-specific options.Gets the optional provider prompt.setLanguageTag(String languageTag) Sets the requested recognition language.Sets an optional provider-specific value.Sets optional provider prompt text.
-
Constructor Details
-
TranscriptionRequest
Creates a file-based transcription request.- Parameters:
audioPath- path to the audio file that should be transcribed- Throws:
IllegalArgumentException- ifaudioPathisnullor empty
-
-
Method Details
-
file
Creates a file-based transcription request.- Parameters:
audioPath- path to the audio file that should be transcribed- Returns:
- a new transcription request
-
getAudioPath
-
getLanguageTag
Gets the requested recognition language.- Returns:
- BCP 47 language tag, or
nullif the provider should choose its default
-
setLanguageTag
Sets the requested recognition language.- Parameters:
languageTag- BCP 47 language tag, ornullto let the provider choose- Returns:
- this request
-
getPrompt
Gets the optional provider prompt.- Returns:
- prompt text, or
nullif no prompt is set
-
setPrompt
Sets optional provider prompt text.- Parameters:
prompt- prompt text, ornullto clear it- Returns:
- this request
-
setOption
Sets an optional provider-specific value.
Passing
nullas the value removes the option.- Parameters:
key- option keyvalue- option value, ornullto remove the option- Returns:
- this request
- Throws:
IllegalArgumentException- ifkeyisnullor empty
-
getOption
-
getOptions
-