All Downloads are FREE. Search and download functionalities are using the official Maven repository.

browserMain.org.w3c.speech.SpeechSynthesisUtterance.kt Maven / Gradle / Ivy

Go to download

Kotlin Multiplatform Text-to-Speech library for Android and browser (Kotlin/JS & Kotlin/Wasm). This library will enable you to use Text-to-Speech in multiplatform Kotlin projects.

There is a newer version: 3.0.0-beta.1
Show newest version
package org.w3c.speech

import js_interop.JsAny

/**
 * The SpeechSynthesisUtterance interface of the Web Speech API represents a speech request.
 * It contains the content the speech service should read and
 * information about how to read it (e.g. language, pitch and volume.)
 */
expect class SpeechSynthesisUtterance {
    constructor()

    constructor(text: String)

    /** Gets and sets the language of the utterance. */
    var lang: String

    /** Gets and sets the pitch at which the utterance will be spoken at. */
    var pitch: Float

    /** Gets and sets the speed at which the utterance will be spoken at. */
    var rate: Float

    /** Gets and sets the text that will be synthesised when the utterance is spoken. */
    var text: String

    /** Gets and sets the voice that will be used to speak the utterance. */
    var voice: SpeechSynthesisVoice?

    /** Gets and sets the volume that the utterance will be spoken at. */
    var volume: Float

    var onstart: ((event: JsAny?) -> Unit)?

    var onend: ((event: JsAny?) -> Unit)?
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy