# VoiceInfo


```
public final class VoiceInfo
```

<br />

*** ** * ** ***

Represents information about a supported text-to-speech voice.

Instances are created by the SDK and returned from `https://developers.google.com/android/reference/com/google/mlkit/genai/texttospeech/SpeechSynthesizer#getSupportedVoices(java.util.Locale)`.

## Summary

| ### Nested types |
|---|
| `public enum https://developers.google.com/android/reference/com/google/mlkit/genai/texttospeech/VoiceInfo.Gender extends https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-enum/index.html` The gender of a voice. |

| ### Public methods |
|---|---|
| `final @https://developer.android.com/reference/androidx/annotation/NonNull.html https://developers.google.com/android/reference/com/google/mlkit/genai/texttospeech/VoiceInfo.Gender` | `https://developers.google.com/android/reference/com/google/mlkit/genai/texttospeech/VoiceInfo#getGender()()` The gender of the voice. |
| `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/texttospeech/VoiceInfo#getLocale()()` The concrete locale of the voice, which may be more specific than the one it was looked up with. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull.html https://developer.android.com/reference/java/lang/String.html` | `https://developers.google.com/android/reference/com/google/mlkit/genai/texttospeech/VoiceInfo#getName()()` The unique name of the voice. |

## Public methods

### getGender

```
public final @NonNull VoiceInfo.Gender getGender()
```

The gender of the voice.

### getLocale

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

The concrete locale of the voice, which may be more specific than the one it was looked up with. `https://developers.google.com/android/reference/com/google/mlkit/genai/texttospeech/SpeechSynthesizer#checkStatus(com.google.mlkit.genai.texttospeech.VoiceInfo)`, `https://developers.google.com/android/reference/com/google/mlkit/genai/texttospeech/SpeechSynthesizer#download(com.google.mlkit.genai.texttospeech.VoiceInfo)`, and the language fallback in `https://developers.google.com/android/reference/com/google/mlkit/genai/texttospeech/SpeechSynthesizer#synthesize(com.google.mlkit.genai.texttospeech.SpeechSynthesizerRequest)` all key off this rather than the locale configured in `https://developers.google.com/android/reference/com/google/mlkit/genai/texttospeech/SpeechSynthesizerOptions`.

### getName

```
public final @NonNull String getName()
```

The unique name of the voice.