Skip to content

Commit

Permalink
Upgrade piper to v1.1 (home-assistant#3150)
Browse files Browse the repository at this point in the history
  • Loading branch information
synesthesiam authored and nervousapps committed Aug 28, 2023
1 parent 7ddf5c0 commit bbf26fc
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 81 deletions.
8 changes: 8 additions & 0 deletions piper/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 1.1.0

- Upgrade to Piper 1.2
- Add over 30 new voices
- Change voice format to `<language>_<REGION>-<name>-<quality>`
- Voices are downloaded from https://huggingface.co/rhasspy/piper-voices
- Add `max_piper_procs` option

## 0.1.3

- Fix multi-line input
Expand Down
91 changes: 16 additions & 75 deletions piper/DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,85 +26,15 @@ for more information.

[Listen to voice samples](https://rhasspy.github.io/piper-samples/)

Name of the Piper voice to use, such as `en-us-lessac-low` (the default).
The following voices are available:

- Catalan
- `ca-upc_ona-x-low`
- `ca-upc_pau-x-low`
- Danish
- `da-nst_talesyntese-medium`
- German
- `de-eva_k-x-low`
- `de-thorsten-low`
- `de-karlsson-low`
- `de-kerstin-low`
- `de-pavoque-low`
- `de-ramona-low`
- English
- `en-gb-alan-low`
- `en-gb-southern_english_female-low`
- `en-us-amy-low`
- `en-us-kathleen-low`
- `en-us-lessac-low`
- `en-us-lessac-medium`
- `en-us-libritts-high`
- `en-us-ryan-high`
- `en-us-ryan-low`
- `en-us-ryan-medium`
- Spanish
- `es-carlfm-x-low`
- `es-mls_10246-low`
- `es-mls_9972-low`
- Finnish
- `fi-harri-low`
- French
- `fr-siwis-low`
- `fr-siwis-medium`
- `fr-gilles-low`
- `fr-mls_1840-low`
- Icelandic
- `is-bui-medium`
- `is-salka-medium`
- `is-steinn-medium`
- `is-ugla-medium`
- Italian
- `it-riccardo_fasol-x-low`
- Kazakh
- `kk-iseke-x-low`
- `kk-issai-high`
- `kk-raya-x-low`
- Nepali
- `ne-google-medium`
- `ne-google-x-low`
- Dutch
- `nl-mls_7432-low`
- `nl-nathalie-x-low`
- `nl-rdh-medium`
- `nl-rdh-x-low`
- `nl-mls_5809-low`
- Norwegian
- `no-talesyntese-medium`
- Polish
- `pl-mls_6892-low`
- Brazilian Portuguese
- `pt-br-edresson-low`
- Russian
- `ru-irinia-medium`
- Ukrainian
- `uk-lada-x-low`
- Vietnamese
- `vi-25hours-single-low`
- `vi-vivos-x-low`
- Chinese
- `zh-cn-huayan-x-low`

Voices are named according to the following scheme: `<language>-<name>-<quality>`
Name of the Piper voice to use, such as `en_US-lessac-medium` (the default).
Voice models are automatically downloaded from https://huggingface.co/rhasspy/piper-voices/tree/v1.0.0

Voices are named according to the following scheme: `<language>_<REGION>-<name>-<quality>`
The `<name>` portion comes from the dataset used to train the voice or the speaker's name if it was provided.

A voice's quality comes in 4 different levels:

- `x-low` - 16Khz, smallest/fastest
- `x_low` - 16Khz, smallest/fastest
- `low` - 16Khz, fast
- `medium` - 22.05Khz, slower but better sounding
- `high` - 22.05Khz, slowest but best sounding
Expand All @@ -129,6 +59,17 @@ Controls the variability of audio by adding noise during audio generation. The e

Controls the variability of speaking cadence (phoneme widths). The effect highly depends on the voice itself, but in general a value of 0 removes variability and values above 1 produce extreme stutters and pauses.

### Option: `max_piper_procs`

Number of Piper processes to run simultaneously (default is 1). Each Piper process loads a single voice model into RAM, so using multiple voices at the same time requires:

- Starting/stopping Piper processes as voices are used, or
- Running more Piper processes

This add-on will start a Piper process for each requested voice up to `max_piper_procs`. After that, the least recently used voice will be stopped.
Increase `max_piper_procs` if you need to quickly switch between multiple voices, but beware that this will increase RAM usage by the add-on.


## Support

Got questions?
Expand Down
4 changes: 2 additions & 2 deletions piper/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ codenotary:
signer: [email protected]
base_image: [email protected]
args:
PIPER_LIB_VERSION: 0.0.3
PIPER_RELEASE: v0.0.2
PIPER_LIB_VERSION: 1.2.0
PIPER_RELEASE: v1.2.0
12 changes: 8 additions & 4 deletions piper/config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
version: 0.1.3
version: 1.2.0
slug: piper
name: Piper
description: Text-to-speech with Piper
Expand All @@ -10,20 +10,24 @@ arch:
init: false
discovery:
- wyoming
backup_exclude:
- "*.onnx"
options:
voice: en-us-lessac-low
voice: en_US-lessac-medium
speaker: 0
length_scale: 1.0
noise_scale: 0.667
noise_w: 0.333
max_piper_procs: 1
schema:
voice: |
list(ca-upc_ona-x-low|ca-upc_pau-x-low|da-nst_talesyntese-medium|de-eva_k-x-low|de-karlsson-low|de-kerstin-low|de-pavoque-low|de-ramona-low|de-thorsten-low|el-gr-rapunzelina-low|en-gb-alan-low|en-gb-southern_english_female-low|en-us-amy-low|en-us-danny-low|en-us-kathleen-low|en-us-lessac-low|en-us-lessac-medium|en-us-libritts-high|en-us-ryan-high|en-us-ryan-low|en-us-ryan-medium|es-carlfm-x-low|es-mls_10246-low|es-mls_9972-low|fi-harri-low|fr-gilles-low|fr-mls_1840-low|fr-siwis-low|fr-siwis-medium|is-bui-medium|is-salka-medium|is-steinn-medium|is-ugla-medium|it-riccardo_fasol-x-low|kk-iseke-x-low|kk-issai-high|kk-raya-x-low|ne-google-medium|ne-google-x-low|nl-mls_5809-low|nl-mls_7432-low|nl-nathalie-x-low|nl-rdh-medium|nl-rdh-x-low|no-talesyntese-medium|pl-mls_6892-low|pt-br-edresson-low|ru-irinia-medium|uk-lada-x-low|vi-25hours-single-low|vi-vivos-x-low|zh-cn-huayan-x-low)
list(ca_ES-upc_ona-medium|ca_ES-upc_ona-x_low|ca_ES-upc_pau-x_low|da_DK-talesyntese-medium|de_DE-eva_k-x_low|de_DE-karlsson-low|de_DE-kerstin-low|de_DE-pavoque-low|de_DE-ramona-low|de_DE-thorsten_emotional-medium|de_DE-thorsten-low|de_DE-thorsten-medium|el_GR-rapunzelina-low|en_GB-alan-low|en_GB-alan-medium|en_GB-alba-medium|en_GB-aru-medium|en_GB-jenny_dioco-medium|en_GB-northern_english_male-medium|en_GB-semaine-medium|en_GB-southern_english_female-low|en_GB-vctk-medium|en_US-amy-low|en_US-amy-medium|en_US-arctic-medium|en_US-danny-low|en_US-joe-medium|en_US-kathleen-low|en_US-kusal-medium|en_US-l2arctic-medium|en_US-lessac-high|en_US-lessac-low|en_US-lessac-medium|en_US-libritts-high|en_US-ryan-high|en_US-ryan-low|en_US-ryan-medium|es_ES-carlfm-x_low|es_ES-davefx-medium|es_ES-mls_10246-low|es_ES-mls_9972-low|es_ES-sharvard-medium|es_MX-ald-medium|fi_FI-harri-low|fi_FI-harri-medium|fr_FR-gilles-low|fr_FR-mls_1840-low|fr_FR-siwis-low|fr_FR-siwis-medium|fr_FR-upmc-medium|is_IS-bui-medium|is_IS-salka-medium|is_IS-steinn-medium|is_IS-ugla-medium|it_IT-riccardo-x_low|ka_GE-natia-medium|kk_KZ-iseke-x_low|kk_KZ-issai-high|kk_KZ-raya-x_low|lb_LU-marylux-medium|ne_NP-google-medium|ne_NP-google-x_low|nl_BE-nathalie-medium|nl_BE-nathalie-x_low|nl_BE-rdh-medium|nl_BE-rdh-x_low|nl_NL-mls_5809-low|nl_NL-mls_7432-low|no_NO-talesyntese-medium|pl_PL-darkman-medium|pl_PL-gosia-medium|pl_PL-mls_6892-low|pt_BR-edresson-low|pt_BR-faber-medium|ro_RO-mihai-medium|ru_RU-denis-medium|ru_RU-dmitri-medium|ru_RU-irina-medium|ru_RU-ruslan-medium|sr_RS-serbski_institut-medium|sv_SE-nst-medium|sw_CD-lanfrica-medium|tr_TR-dfki-medium|uk_UA-lada-x_low|uk_UA-ukrainian_tts-medium|vi_VN-25hours_single-low|vi_VN-vais1000-medium|vi_VN-vivos-x_low|zh_CN-huayan-medium|zh_CN-huayan-x_low|ca-upc_ona-x-low|ca-upc_pau-x-low|da-nst_talesyntese-medium|de-eva_k-x-low|de-karlsson-low|de-kerstin-low|de-pavoque-low|de-ramona-low|de-thorsten-low|el-gr-rapunzelina-low|en-gb-alan-low|en-gb-southern_english_female-low|en-us-amy-low|en-us-danny-low|en-us-kathleen-low|en-us-lessac-low|en-us-lessac-medium|en-us-libritts-high|en-us-ryan-high|en-us-ryan-low|en-us-ryan-medium|es-carlfm-x-low|es-mls_10246-low|es-mls_9972-low|fi-harri-low|fr-gilles-low|fr-mls_1840-low|fr-siwis-low|fr-siwis-medium|is-bui-medium|is-salka-medium|is-steinn-medium|is-ugla-medium|it-riccardo_fasol-x-low|kk-iseke-x-low|kk-issai-high|kk-raya-x-low|ne-google-medium|ne-google-x-low|nl-mls_5809-low|nl-mls_7432-low|nl-nathalie-x-low|nl-rdh-medium|nl-rdh-x-low|no-talesyntese-medium|pl-mls_6892-low|pt-br-edresson-low|ru-irinia-medium|uk-lada-x-low|vi-25hours-single-low|vi-vivos-x-low|zh-cn-huayan-x-low)
speaker: int
length_scale: float
noise_scale: float
noise_w: float
max_piper_procs: int
ports:
"10200/tcp": null
homeassistant: 2023.5.0.dev20230418
homeassistant: 2023.8.0.dev20230718
image: homeassistant/{arch}-addon-piper
1 change: 1 addition & 0 deletions piper/rootfs/etc/s6-overlay/s6-rc.d/piper/run
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ exec python3 -m wyoming_piper \
--noise-w "$(bashio::config 'noise_w')" \
--speaker "$(bashio::config 'speaker')" \
--voice "$(bashio::config 'voice')" \
--max-piper-procs "$(bashio::config 'max_piper_procs')" \
--data-dir /data \
--download-dir /data

0 comments on commit bbf26fc

Please sign in to comment.