You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Go to file
Nolan Darilek f7239366f0 Add command to build the web example. 2 years ago
.github/workflows Remove bindings publish from CI. 2 years ago
examples S/TTS/Tts/ here as well. 2 years ago
src And again, VSCode's find/replace didn't catch this. *grumble* 2 years ago
.gitignore Ignore DLL files. 2 years ago
Cargo.toml Bump version. 2 years ago
Makefile.toml Add command to build the web example. 2 years ago Bump version, and use automatically-provided feature provided by optional tolk dependency. 2 years ago Bump Windows dependency and update accordingly. Also, fix an acronym Clippy warning. 2 years ago


This library provides a high-level Text-To-Speech (TTS) interface supporting various backends. Currently supported backends are:

  • Windows
    • Screen readers/SAPI via Tolk (requires tolk Cargo feature)
    • WinRT
  • Linux via Speech Dispatcher
  • MacOS/iOS
    • AppKit on MacOS 10.13 and below
    • AVFoundation on MacOS 10.14 and above, and iOS
  • Android
  • WebAssembly

Android Setup

On most platforms, this library is plug-and-play. Because of JNI's complexity, Android setup is a bit more involved. In general, look to the Android example for guidance. Here are some rough steps to get going:

  • Set up Cargo.toml as the example does. Be sure to depend on ndk-glue.
  • Place appropriately in your app. This is needed to support various Android TTS callbacks.
  • Create a main activity similar to MainActivity.kt. In particular, you need to derive, and you need a System.loadLibrary(...) call appropriate for your app. System.loadLibrary(...) is needed to trigger JNI_OnLoad.
    • Even though you've loaded the library in your main activity, add a metadata tag to your activity in AndroidManifest.xml referencing it. Yes, this is redundant but necessary.
  • Set if your various build.gradle scripts to reference the plugins, dependencies, etc. from the example. In particular, you'll want to set up cargo-ndk-android-gradle and either depend on androidx.annotation or otherwise configure your app to keep the class rs.tts.Bridge.

And I think that should about do it. Good luck!