SpeechResult

sealed class SpeechResult

Sealed result type representing the outcome of a speak or synthesize operation.

when (val result = tts.speak("Bonjour")) {
is SpeechResult.Success -> Log.d("TTS", "Speech dispatched")
is SpeechResult.Error -> Log.e("TTS", "Failed: ${result.reason}")
SpeechResult.NotReady -> Log.w("TTS", "Engine not initialized yet")
}

Inheritors

Types

Link copied to clipboard
data class Error(val reason: String) : SpeechResult

The request failed.

Link copied to clipboard
data object NotReady : SpeechResult

The TTS engine is not yet initialized. Wait for BetterFrenchTts.Config.onReady.

Link copied to clipboard
data object Success : SpeechResult

The speech or synthesis request was dispatched successfully.