SpeechTranslatorOptionsKt

public final class SpeechTranslatorOptionsKt


Summary

Public methods

static final @NonNull SpeechTranslatorOptions
speechTranslatorOptions(
    @NonNull Locale sourceLocale,
    @NonNull Locale targetLocale,
    @ExtensionFunctionType @NonNull Function1<@NonNull SpeechTranslatorOptions.Builder, Unit> init
)

Helper method to construct a SpeechTranslatorOptions in a DSL-like manner.

Public methods

speechTranslatorOptions

public static final @NonNull SpeechTranslatorOptions speechTranslatorOptions(
    @NonNull Locale sourceLocale,
    @NonNull Locale targetLocale,
    @ExtensionFunctionType @NonNull Function1<@NonNull SpeechTranslatorOptions.Builder, Unit> init
)

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.
}