Text-to-Speech library for Kotlin Multiplatform. Supports targets Android, iOS, macOS and browser (js and wasmJs).
Uses Kotlin Multiplatform with support for the following targets:
Platform | Language | Support |
---|---|---|
Android | Kotlin/JVM | ✅ |
Browser | Kotlin/JS | ✅ |
Browser | Kotlin/Wasm | ✅ |
Browser | JS, TS | ❌ Support ended in v2.0 |
Desktop | Kotlin/JVM | |
iOS, MacOS | Kotlin/Native | ✅ |
Other Kotlin/Native | Kotlin/Native | ❌ |
- Kotlin Multiplatform API for text-to-speech on the following platforms: Android, iOS, macOS, js and wasmJs
- Await synthesis completion using Kotlin Coroutines
- Supports the following configuration:
- Voice pitch & rate
- Volume
- Voice selection
- Language (through voice selection)
- Compose Multiplatform support with
rememberTextToSpeechOrNull()
available in thetts-compose
package.
A build tool like Gradle or Maven.
libs.versions.toml
[versions]
textToSpeech = "3.0.0"
[libraries]
textToSpeech = { module = "nl.marc-apps:tts", version.ref = "textToSpeech" }
# Optional: Extensions for Compose
textToSpeech-compose = { module = "nl.marc-apps:tts-compose", version.ref = "textToSpeech" }
Gradle
And add the library to your dependencies:
dependencies {
implementation("nl.marc-apps:tts:3.0.0")
// Optional: Extensions for Compose
implementation("nl.marc-apps:tts-compose:3.0.0")
}
Or
kotlin {
sourceSets {
commonMain.dependencies {
implementation("nl.marc-apps:tts:3.0.0")
// Optional: Extensions for Compose
implementation("nl.marc-apps:tts-compose:3.0.0")
}
}
}
View documentation generated by Dokka
Go to the /demo directory of this project.
This project is published under the MIT License. Read more about this license in the LICENSE
file.