Skip to content

Latest commit

 

History

History
132 lines (106 loc) · 4.65 KB

README.md

File metadata and controls

132 lines (106 loc) · 4.65 KB

TextToSpeechKt

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

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

Gradle

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: Maven Central

Apache Maven

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: 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