com.google.mlkit.genai.speechtranslation
Interfaces
SpeechTranslatorResponse |
The response from the speech translator. |
Classes
SpeechTranslator |
Provides an interface for performing on device speech translation. |
SpeechTranslatorOptions |
Options for |
SpeechTranslatorOptions.Builder |
Builder for |
SpeechTranslatorRequest |
Request for |
SpeechTranslatorRequest.Builder |
Builder for |
SpeechTranslatorResponse.Audio |
Represents a successful audio output result. |
SpeechTranslatorResponse.ErrorResponse |
Represents an error that occurred during translation. |
SpeechTranslatorResponse.Text |
Represents a successful text translation result. |
TranslationAudio |
Represents an audio packet for the speech translator. |
Objects
SpeechTranslation |
Entry point to get a |
SpeechTranslatorResponse.CompletedResponse |
Represents the completion of the translation session. |
Top-level functions summary
SpeechTranslatorOptions |
speechTranslatorOptions(Helper method to construct a |
SpeechTranslatorRequest |
speechTranslatorRequest(Helper method to construct a |
Top-level functions
speechTranslatorOptions
fun speechTranslatorOptions(
sourceLocale: Locale,
targetLocale: Locale,
init: SpeechTranslatorOptions.Builder.() -> Unit = {}
): SpeechTranslatorOptions
Helper method to construct a SpeechTranslatorOptions in a DSL-like manner.
Example usage:
val options = speechTranslatorOptions(sourceLocale, targetLocale) {
executor = myExecutor // Set the [Executor] on which background tasks should be run.
}
speechTranslatorRequest
fun speechTranslatorRequest(
audioFlow: Flow<TranslationAudio>,
init: SpeechTranslatorRequest.Builder.() -> Unit = {}
): SpeechTranslatorRequest
Helper method to construct a SpeechTranslatorRequest in a DSL-like manner.
Example usage:
val request = speechTranslatorRequest(audioFlow)