# SpeechTranslatorOptionsKt


```
public final class SpeechTranslatorOptionsKt
```

<br />

*** ** * ** ***

## Summary

| ### Public methods |
|---|---|
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull.html https://developers.google.com/android/reference/com/google/mlkit/genai/speechtranslation/SpeechTranslatorOptions` | `https://developers.google.com/android/reference/com/google/mlkit/genai/speechtranslation/SpeechTranslatorOptionsKt#speechTranslatorOptions(java.util.Locale,java.util.Locale,kotlin.Function1)( @https://developer.android.com/reference/androidx/annotation/NonNull.html https://developer.android.com/reference/java/util/Locale.html sourceLocale, @https://developer.android.com/reference/androidx/annotation/NonNull.html https://developer.android.com/reference/java/util/Locale.html targetLocale, @https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-extension-function-type/index.html @https://developer.android.com/reference/androidx/annotation/NonNull.html Function1<@https://developer.android.com/reference/androidx/annotation/NonNull.html https://developers.google.com/android/reference/com/google/mlkit/genai/speechtranslation/SpeechTranslatorOptions.Builder, https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html> init )` Helper method to construct a `https://developers.google.com/android/reference/com/google/mlkit/genai/speechtranslation/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 `https://developers.google.com/android/reference/com/google/mlkit/genai/speechtranslation/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.
}
```