# SpeechTranslatorRequest


```
public final class SpeechTranslatorRequest
```

<br />

*** ** * ** ***

Request for `https://developers.google.com/android/reference/com/google/mlkit/genai/speechtranslation/SpeechTranslator`.

## Summary

| ### Nested types |
|---|
| `public final class https://developers.google.com/android/reference/com/google/mlkit/genai/speechtranslation/SpeechTranslatorRequest.Builder` Builder for `https://developers.google.com/android/reference/com/google/mlkit/genai/speechtranslation/SpeechTranslatorRequest`. |

| ### Public methods |
|---|---|
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull.html https://developers.google.com/android/reference/com/google/mlkit/genai/speechtranslation/SpeechTranslatorRequest.Builder` | `https://developers.google.com/android/reference/com/google/mlkit/genai/speechtranslation/SpeechTranslatorRequest#builder(kotlinx.coroutines.flow.Flow)(@https://developer.android.com/reference/androidx/annotation/NonNull.html https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-flow/index.html<@https://developer.android.com/reference/androidx/annotation/NonNull.html https://developers.google.com/android/reference/com/google/mlkit/genai/speechtranslation/TranslationAudio> audioFlow)` Creates a new `https://developers.google.com/android/reference/com/google/mlkit/genai/speechtranslation/SpeechTranslatorRequest.Builder` that reads audio packets from `https://developers.google.com/android/reference/com/google/mlkit/genai/speechtranslation/SpeechTranslatorRequest.Companion#builder(kotlinx.coroutines.flow.Flow)`. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull.html https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-flow/index.html<@https://developer.android.com/reference/androidx/annotation/NonNull.html https://developers.google.com/android/reference/com/google/mlkit/genai/speechtranslation/TranslationAudio>` | `https://developers.google.com/android/reference/com/google/mlkit/genai/speechtranslation/SpeechTranslatorRequest#getAudioFlow()()` the stream of audio packets to translate. |

## Public methods

### builder

```
public static final @NonNull SpeechTranslatorRequest.Builder builder(@NonNull Flow<@NonNull TranslationAudio> audioFlow)
```

Creates a new `https://developers.google.com/android/reference/com/google/mlkit/genai/speechtranslation/SpeechTranslatorRequest.Builder` that reads audio packets from `https://developers.google.com/android/reference/com/google/mlkit/genai/speechtranslation/SpeechTranslatorRequest.Companion#builder(kotlinx.coroutines.flow.Flow)`.

### getAudioFlow

```
public final @NonNull Flow<@NonNull TranslationAudio> getAudioFlow()
```

the stream of audio packets to translate. Each `https://developers.google.com/android/reference/com/google/mlkit/genai/speechtranslation/TranslationAudio` carries the locale it was spoken in, which must be either the source or the target locale configured on `https://developers.google.com/android/reference/com/google/mlkit/genai/speechtranslation/SpeechTranslatorOptions`. Completing the flow signals end of input and ends the session.