TextToSpeechInstance

A TTS instance. Should be closed when no longer in use.

Inheritors

Types

Link copied to clipboard
object Companion
Link copied to clipboard

Functions

Link copied to clipboard
abstract override fun close()

Clears the internal queue and closes used resources (if possible)

Link copied to clipboard
abstract fun enqueue(text: String, clearQueue: Boolean = false)

Adds the given text to the internal queue, unless isMuted is true or volume equals 0.

Link copied to clipboard
abstract operator fun plusAssign(text: String)

Adds the given text to the internal queue, unless isMuted is true or volume equals 0.

Link copied to clipboard
abstract fun say(text: String, clearQueue: Boolean = false, callback: (Result<TextToSpeechInstance.Status>) -> Unit)
abstract suspend fun say(text: String, clearQueue: Boolean = false, resumeOnStatus: TextToSpeechInstance.Status = Status.FINISHED)

Adds the given text to the internal queue, unless isMuted is true or volume equals 0.

Link copied to clipboard
abstract fun stop()

Clears the internal queue, but doesn't close used resources.

Properties

Link copied to clipboard
abstract var isMuted: Boolean

Alternative to setting volume to zero. Setting this to true (and back to false) doesn't change the value of volume. Changes only affect new calls to the say method.

Link copied to clipboard
abstract val language: String

Returns a BCP 47 language tag of the selected voice on supported platforms. May return the language code as ISO 639 on older platforms.

Link copied to clipboard
abstract var pitch: Float
Link copied to clipboard
abstract var rate: Float
Link copied to clipboard
abstract var volume: Int

The output volume, which is an integer between 0 and 100, set to 100(%) by default. Changes only affect new calls to the say method.