https://github.com/httpjamesm/tauri-plugin-tts
Text to speech plugin for Tauri mobile apps
https://github.com/httpjamesm/tauri-plugin-tts
android avspeechsynthesizer ios kotlin swift tauri texttospeech tts
Last synced: 3 months ago
JSON representation
Text to speech plugin for Tauri mobile apps
- Host: GitHub
- URL: https://github.com/httpjamesm/tauri-plugin-tts
- Owner: httpjamesm
- Created: 2024-11-22T06:01:06.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-22T08:46:31.000Z (over 1 year ago)
- Last Synced: 2025-07-24T02:06:24.478Z (11 months ago)
- Topics: android, avspeechsynthesizer, ios, kotlin, swift, tauri, texttospeech, tts
- Language: Swift
- Homepage:
- Size: 873 KB
- Stars: 4
- Watchers: 1
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Tauri Plugin tts
Text to speech plugin for Tauri apps.
Supported platforms:
- Android API 21+ (Using [TextToSpeech](https://developer.android.com/reference/android/speech/tts/TextToSpeech))
- iOS 13+, 16+ recommended for the highest quality voices (Using [AVSpeechSynthesizer](https://developer.apple.com/documentation/avfaudio/avspeechsynthesizer/))
## Install
Add to your Cargo.toml:
```toml
tauri-plugin-tts = { git = "https://github.com/httpjamesm/tauri-plugin-tts.git" }
```
Connect to your Tauri builder:
```rust
#[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() {
tauri::Builder::default()
.invoke_handler(tauri::generate_handler![greet])
.plugin(tauri_plugin_tts::init())
.run(tauri::generate_context!())
.expect("error while running tauri application");
}
```
## Permissions
Add `tts:allow-speak` to your capabilities file.
## Android Instructions
Make sure to add the following to your AndroidManifest.xml:
```xml
```
## iOS Instructions
The user must have at least one "Enhanced" or "Premium" voice installed. Premium is recommended on iOS 16+ as they are the most natural sounding voices. By default, they may not be installed, so you might want to prompt the user to install one.
If the device is on mute, the speech will not be audible.
## Usage
```typescript
import { invoke } from "@tauri-apps/api/core";
invoke("plugin:tts|speak", { text: "Hello, world!" });
```