2024-02-19 22:51:41 +01:00
# Piper Text-to-Speech
This voice service allows you to use the open source library [Piper ](https://github.com/rhasspy/piper ) as your TTS service in openHAB.
[Piper ](https://github.com/rhasspy/piper ) is a fast, local neural text to speech system that sounds great and is optimized for the Raspberry Pi 4.
## Supported platforms
The add-on is compatible with the following platforms:
2024-09-28 17:46:53 +02:00
- linux (armv7l, aarch64, x86_64, min GLIBC version 2.31)
- macOS (x86_64 min version 11.0, aarch64 min version 13.0)
- win64 (x86_64 min version Windows 10).
2024-02-19 22:51:41 +01:00
## Configuration
2024-05-19 12:29:18 +02:00
## Setting up dependencies
The add-on will download the required dependencies at first activation.
2024-12-28 17:04:31 +01:00
If your openHAB installation does not have access to the Internet, you need to download the [piper-jni jar file ](https://repo1.maven.org/maven2/io/github/givimad/piper-jni/1.2.0-c0670df/piper-jni-1.2.0-c0670df.jar ) and place it at '< OPENHAB_USERDATA > /piper/'.
2024-05-19 12:29:18 +02:00
2024-02-19 22:51:41 +01:00
### Downloading Voice Model Files
You can find the link to the available voices at the [Piper README ](https://github.com/rhasspy/piper ).
Each voice model is composed of two files an onnx runtime model file with extension '.onnx' and a model config file with extension '.onnx.json'.
For the add-on to load your voices you need both to be named equal (obviously excluding their extensions).
You should place both voice files at '< OPENHAB_USERDATA > /piper/'.
After that the UI should display your available voices at 'Settings / System Settings / Voice'.
### Multi Speaker Voices
Models that support multiples speakers are shown as multiple voices in openHAB.
### Text to Speech Configuration
Use your favorite configuration UI to edit **Settings / Other Services - Piper Text-to-Speech** :
2024-09-28 17:46:53 +02:00
- **Preload model** - Keep last voice model used loaded in memory, these way it can be reused on next execution if the voice option matches.
2024-02-19 22:51:41 +01:00
### Configuration via a text file
In case you would like to setup the service via a text file, create a new file in `$OPENHAB_ROOT/conf/services` named `pipertts.cfg`
Its contents should look similar to:
2024-09-29 12:47:18 +02:00
```ini
2024-02-19 22:51:41 +01:00
org.openhab.voice.pipertts:preloadModel=true
```
### Default Text-to-Speech Configuration
You can setup your preferred default Speech-to-Text in the UI:
2024-09-28 17:46:53 +02:00
- Go to **Settings** .
- Edit **System Services - Voice** .
- Set **Piper** as **Text-to-Speech** .
- Set your **Default Voice** .
2024-02-19 22:51:41 +01:00
In case you would like to set up these settings via a text file, you can edit the file `runtime.cfg` in `$OPENHAB_ROOT/conf/services` and set the following entries:
2024-09-29 12:47:18 +02:00
```ini
2024-02-19 22:51:41 +01:00
org.openhab.voice:defaultTTS=pipertts
```