> ## Documentation Index
> Fetch the complete documentation index at: https://docs.runanywhere.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Voices

> List and select a speaking voice

```kotlin theme={"theme":"css-variables"}
val voices = RunAnywhere.tts.voices()
```

## Signature

```kotlin theme={"theme":"css-variables"}
suspend fun voices(): List<Voice>
```

The list reflects the loaded speech model, so call it after the model is in place rather than
at launch. Load a different TTS model and the list changes.

## Selecting one

```kotlin theme={"theme":"css-variables"}
val handle = RunAnywhere.tts.speak(
    "Hello",
    TtsOptions(voice = "en_US-amy-medium")
)
```

With `voice` unset, the model's own default is used.

## Language and voice are separate

`language` sets the language code; `voice` picks a speaker. A multi-voice model exposes
several speakers for one language, and a single-voice model ignores `voice` entirely.

```kotlin theme={"theme":"css-variables"}
TtsOptions(
    voice = "en_US-amy-medium",
    language = "en-US",
    speed = 1.0f,
    pitch = 1.0f
)
```

## Letting a person choose

```kotlin theme={"theme":"css-variables"}
class VoicePicker : ViewModel() {
    private val _voices = MutableStateFlow<List<Voice>>(emptyList())
    val voices = _voices.asStateFlow()

    var selected: String? = null

    fun load() {
        viewModelScope.launch {
            _voices.value = RunAnywhere.tts.voices()
        }
    }

    fun preview() {
        val voice = selected ?: return
        viewModelScope.launch {
            RunAnywhere.tts.speak("This is how I sound.", TtsOptions(voice = voice))
        }
    }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.