TextToSpeechKt

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

MIT License

Stars
9
Committers
2

TextToSpeechKt

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

📔 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 Kotlin/Native
Other Kotlin/Native Kotlin/Native

🎯 Features

  • Create the engine with Kotlin Coroutines
  • Await speech synthesis completion using Kotlin Coroutines
  • Modify the volume or mute the volume entirely
  • Modify the voice pitch
  • Modify the voice rate
  • Compose support with rememberTextToSpeechOrNull() (works in multiplatform code!)

🧰 Getting Started

‼️ Prerequisites

A build tool like Gradle or Maven.

⚙️ Installation

Configure the Maven Central repository:

repositories {
    mavenCentral()
}

And add the library to your dependencies:

dependencies {
    implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.0")
    implementation("nl.marc-apps:tts:2.5.0")

    // Optional: Extensions for Compose
    implementation("nl.marc-apps:tts-compose:2.5.0")
}

Or

kotlin {
    sourceSets {
        commonMain.dependencies { 
            implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.0")
            implementation("nl.marc-apps:tts:2.5.0")

            // Optional: Extensions for Compose 
            implementation("nl.marc-apps:tts-compose:2.5.0")
        }
    }
}

Make sure to configure the latest stable version:

Add the library to your dependencies:

<dependency>
    <groupId>org.jetbrains.kotlinx</groupId>
    <artifactId>kotlinx-coroutines-core</artifactId>
    <version>1.8.0</version>
</dependency>
<dependency>
    <groupId>nl.marc-apps</groupId>
    <artifactId>tts</artifactId>
    <version>2.5.0</version>
</dependency>
<!-- Optional: Extensions for Compose -->
<dependency>
    <groupId>nl.marc-apps</groupId>
    <artifactId>tts-compose</artifactId>
    <version>2.5.0</version>
</dependency>

Make sure to configure the latest stable version:

👀 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

Package Rankings
Top 37.74% on Repo1.maven.org
Badges
Extracted from project README's
Gradle deployment Quality Gate Status Maven Central License Maven Central Maven Central
Related Projects