chrys87 / fenrir

An TTY screenreader for Linux.
GNU Lesser General Public License v3.0
47 stars 13 forks source link

How to configure Fenrir to use MBROLA voice in eSpeak NG? #20

Closed valdisvi closed 6 years ago

valdisvi commented 6 years ago

What would be the easiest (most proper) way to configure Fenrir to use MBROLA voice in eSpeak NG? E.g. if one wish to use mb-en1 voice instead of just internally generated en voice?

chrys87 commented 6 years ago

what version are you using? what speech driver? assuming you are using master with the default settings (genericDriver) also assuming espeak-ng/ espeak and mbrola is installed properly espeak-ng -v mb-en1 "this is a test" speaks "this is a test" in the voice you want, you can just run fenrir as the following to test it: sudo src/fenrir -o "speech#voice=mb-en1" or if you want to have it persistent you can change it in settings.conf section [speech] setting voice from voice=en-us to the following: voice=mb-en1

restart fenrir, thats it.

valdisvi commented 6 years ago

Thanks! I'm testing Arch on Raspberry Pi 3 with image from https://public.f123.org/

valdisvi commented 6 years ago

When I changed /etc/fenrir/settings/settings.conffile, I didn't get any difference. Can't it be that some other settings (e.g. driver or something) should be also changed?

chrys87 commented 6 years ago

When I changed /etc/fenrir/settings/settings.conffile, I didn't get any difference. Can't it be that some other settings (e.g. driver or something) should be also changed?

indeed this could be the case. i do not know what settings (or what version of fenrir) are shipped by f123 by default. maybe they use the speechdDriver (for speech-dispatcher). Could you verify what value you currently have for driver= in section [speech]? The changes I noted above assuming that genericDriver is used (what is currently fenrirs default in master) https://raw.githubusercontent.com/chrys87/fenrir/master/config/settings/settings.conf to change speechdDriver to generic you need to replace the settings to match the following:

driver=genericDriver
module=
language=
voice=mb-en1

or start fenrir cia commandline: sudo fenrir -o "speech#driver=genericDriver;speech#module=;speech#language=;speech#voice=mb-en1" what overwrites the settingsfile per parameter. so module and language needs to be empty since this is not required by "genericDriver" what just uses espeak directly.

chrys87 commented 6 years ago

howdy, its me agein :). i just did a look a your repos and found the following fenrir settings file. https://github.com/valdisvi/files-F123Light/blob/master/files/etc/fenrir/settings/settings%40en_US.UTF-8.conf indeed it is using speech-dispatcher by default. i think most easy is to use genericDriver for mbrola.

I do not know if the espeak module of speech-dispatcher supports mbrola voices I would need to investigate this first. spd-say -L lists all voices to get the right parameters). but using genericDriver works for sure.

chrys87 commented 6 years ago

Does it work?

valdisvi commented 6 years ago

Following is e-mail I received from F123 image maintainer:

The Fenrir configuration that ships with F123 is using the speechd driver for consistency with Orca, and because the generic driver isn't speaking on the Raspberry Pi for some reason. That said, even if the generic driver did in fact speak, the speechd driver will still need to be used for consistency. It's best if possible for the MBROLA installation script to be able to make a single change to speech-dispatcher rather than having to modify Fenrir's configuration on-the-fly and still having to modify speech-dispatcher's configuration for Fenrir. So the ability to make speech-dispatcher work with MBROLA if and only if a voice is installed is actually of higher importance than making Fenrir's generic driver work with it, since Fenrir and Orca are both capable of using speech-dispatcher for speech output. I hope this explains the difficulty I'm having.

chrys87 commented 6 years ago

because the generic driver isn't speaking on the Raspberry Pi for some reason.

Ohm ok, this sounds interesting to me since the generic speech driver is just using "espeak" as subprocess (so its the same like running it form your command prompt). I will definitive take a look at this on my Pi at home. Is the espeak command working on CLI for you? if not, is the "play" (sox) command working for you (used for fenrirs sound icons)?

I will take a look at home if speech-dispatcher has some support for MBROLA. if this is the case it could be configured for sure.

valdisvi commented 6 years ago

Many thanks in advance!

chrys87 commented 6 years ago

I was not able to look yet into this problem. But i did some googling. It seems that speech-dispatcher is not able to use MBROLA with its espeak backend. it seems that the offical way is using speech-dispatchers generic backend. this is doing the same like fenrir. it fires a subprocess. if it is a espeak problem and play (sox) is working we can use espeak to store the spoken as wav on /tmp and use play to play the file. This is what speech-dispatcher is doing in its generic backend. we can try this if you want.

ghost commented 6 years ago

Yes. I'll try that. It was my next option, though using temporary files many times causes unacceptable delays, especially on slower devices like the Raspberry Pi. I will give it a shot though.

chrys87 commented 6 years ago

Yea i can understand that. but if espeak does not play sound and speech-dispatcher does not support MBROLA i would not see much we can do here but open a bug for the espeak/ speech-dispatcher and hope it get fixed on the right place fast. if i find time at weekend, i will take a look at speech-dispatcher sources. maybe its not that complex to implement.

chrys87 commented 6 years ago

I will close this ticket for now since it is not an fenrir issue. short summery: genericDriver does support MBROLA speechdDriver does not support MBROLA (not a limitation of fenrir but speech-dispatcher does not support it)

I m currently very busy but i will take a look at speech dispatcher as soon as i find some time. could not be that hard to add the support there.