# TranslationAudio


```
public final class TranslationAudio
```

<br />

*** ** * ** ***

Represents an audio packet for the speech translator.

This class is used to wrap raw audio data along with its `https://developer.android.com/reference/java/util/Locale.html` representing the language of the audio, for sending input audio.

## Summary

| ### Public constructors |
|---|
| `https://developers.google.com/android/reference/com/google/mlkit/genai/speechtranslation/TranslationAudio#TranslationAudio(java.util.Locale,kotlin.ByteArray)(@https://developer.android.com/reference/androidx/annotation/NonNull.html https://developer.android.com/reference/java/util/Locale.html locale, @https://developer.android.com/reference/androidx/annotation/NonNull.html byte[] audioBytes)` |

| ### Public methods |
|---|---|
| `boolean` | `https://developers.google.com/android/reference/com/google/mlkit/genai/speechtranslation/TranslationAudio#equals(kotlin.Any)(https://developer.android.com/reference/java/lang/Object.html other)` |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull.html byte[]` | `https://developers.google.com/android/reference/com/google/mlkit/genai/speechtranslation/TranslationAudio#getAudioBytes()()` The raw audio data (PCM 16-bit, 16kHz, mono). |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull.html https://developer.android.com/reference/java/util/Locale.html` | `https://developers.google.com/android/reference/com/google/mlkit/genai/speechtranslation/TranslationAudio#getLocale()()` The language of the audio data. |
| `int` | `https://developers.google.com/android/reference/com/google/mlkit/genai/speechtranslation/TranslationAudio#hashCode()()` |

## Public constructors

### TranslationAudio

```
public TranslationAudio(@NonNull Locale locale, @NonNull byte[] audioBytes)
```

## Public methods

### equals

```
public boolean equals(Object other)
```

### getAudioBytes

```
public final @NonNull byte[] getAudioBytes()
```

The raw audio data (PCM 16-bit, 16kHz, mono).

### getLocale

```
public final @NonNull Locale getLocale()
```

The language of the audio data.

### hashCode

```
public int hashCode()
```