Skip to content

Marc-JB/TextToSpeechKt

Repository files navigation

TextToSpeechKt

Text-to-Speech library for Kotlin Multiplatform. Supports targets Android, iOS, macOS and browser (js and wasmJs).

Gradle deployment Quality Gate Status Maven Central License

📔 Table of Contents

🌟 About the Project

👾 Tech Stack

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 ⚠️ Experimental support
iOS, MacOS Kotlin/Native
Other Kotlin/Native Kotlin/Native

🎯 Features

  • 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 the tts-compose package.

🧰 Getting Started

‼️ Prerequisites

A build tool like Gradle or Maven.

⚙️ Installation

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" }

Make sure to configure the latest stable version: Maven Central

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")
        }
    }
}

Make sure to configure the latest stable version: Maven Central

👀 Usage

Documentation files

View documentation generated by Dokka

Demo projects

Go to the /demo directory of this project.

⚠️ License

This project is published under the MIT License. Read more about this license in the LICENSE file.

💎 Acknowledgements

About

Kotlin Multiplatform Text-to-Speech library for Android, iOS, macOS and browser (Kotlin/JS & Kotlin/Wasm).

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors 3

  •  
  •  
  •  

Languages