# SpeechTranslatorRequest


```
class SpeechTranslatorRequest
```

<br />

*** ** * ** ***

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

## Summary

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

| ### Public companion functions |
|---|---|
| `https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/speechtranslation/SpeechTranslatorRequest.Builder` | `https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/speechtranslation/SpeechTranslatorRequest#builder(kotlinx.coroutines.flow.Flow)(audioFlow: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-flow/index.html<https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/speechtranslation/TranslationAudio>)` Creates a new `https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/speechtranslation/SpeechTranslatorRequest.Builder` that reads audio packets from `https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/speechtranslation/SpeechTranslatorRequest.Companion#builder(kotlinx.coroutines.flow.Flow)`. |

| ### Public properties |
|---|---|
| `https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-flow/index.html<https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/speechtranslation/TranslationAudio>` | `https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/speechtranslation/SpeechTranslatorRequest#audioFlow()` the stream of audio packets to translate. |

## Public companion functions

### builder

```
fun builder(audioFlow: Flow<TranslationAudio>): SpeechTranslatorRequest.Builder
```

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

## Public properties

### audioFlow

```
val audioFlow: Flow<TranslationAudio>
```

the stream of audio packets to translate. Each `https://developers.google.com/android/reference/kotlin/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/kotlin/com/google/mlkit/genai/speechtranslation/SpeechTranslatorOptions`. Completing the flow signals end of input and ends the session.