Elleo / pied

Pied makes it simple to install and manage text-to-speech Piper voices for use with Speech Dispatcher.
https://pied.mikeasoft.com
GNU General Public License v3.0
75 stars 2 forks source link

Request: support usage of multiple voices #7

Open H-Dorina opened 5 months ago

H-Dorina commented 5 months ago

I use pied on ubuntu 22.04 with orca screenreader. I would like to use multiple Piper voices, e.g. Lessac in the web browser and Ryan in the terminal. Please help me on how to achieve this with pied

Elleo commented 4 months ago

Hi @H-Dorina,

This isn't currently possible, but I've been giving it some thought over the weekend and have an idea for how we can support this sort of use case in future versions. The plan would be to support multiple speech dispatcher voice configurations (e.g. MALE1, FEMALE1, MALE2, FEMALE2, etc.), so that the voice can be changed dynamically at run time without needing to change configuration.

However, I'm not clear on what support Orca has for dynamically setting voices based on applications, I haven't been able to find any information about this sort of functionality. Is it something that already exists in Orca? And if so, what are the steps to activate it so that I can test this behaviour?

Thanks, Mike

H-Dorina commented 4 months ago

Unfortunately I can't find any concrete information about orca's dynamic voice change capabilities at runtime. However, on gnome's orca mailing list there is a topic about dynamic language switching: https://mail.gnome.org/archives/orca-list/2010-February/msg00134.html Based on the referred webpage, I think if your app could support multiple speech dispatcher voice configurations, it might be possible that orca can change voice dynamically, since orca is using speech dispatcher. I can help you implementing and testing this approach.

Jopp-gh commented 3 months ago

I think a dynamic voice switch based on the active process wouldn't be too hard, example:

wmctrl -lx -p | grep Gnome-terminal

Additionally, Pied would need some more user preferences to know what voice presets to use for what process. Although I like this request too, it's a fairly custom feature request, not an essential feature , imo.

takov751 commented 3 months ago

As far as i understand all downloaded models should be added to piper.conf with Addvoice line and then instead of ${MODEL_PATH} simply use ${MODEL_BASE_PATH}/${VOICE} .

Similarly to this manual solution i wrote earlier for myself in this discussion https://github.com/rhasspy/piper/discussions/328

 echo \'$DATA\' | /home/username/.var/app/com.mikeasoft.pied/data/pied/piper/piper \
--model /home/username/.var/app/com.mikeasoft.pied/data/pied/models/${VOICE} --output_raw | $PROCESS | $OUTPUT;"

AddVoice "en-us" "MALE1" "en_US-ryan-high.onnx"
AddVoice "de-DE" "MALE1" "de_DE-karlsson-low.onnx"

With this addition DeafaultVoice needs to be set and voicedetection function need some work to detect all installed voice models and detect defaultVoice as well