TextToSpeechInstanceJS

Use from JavaScript/TypeScript code only. Use the TextToSpeechInstance interface from Kotlin code. A TTS instance. Should be closed when no longer in use.

Functions

Link copied to clipboard
fun close()

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

Link copied to clipboard
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
fun stop()

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

Properties

Link copied to clipboard

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 enqueue method.

Link copied to clipboard

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
Link copied to clipboard
var rate: Float
Link copied to clipboard
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 enqueue method.