numediart / MBROLA

MBROLA is a speech synthesizer based on the concatenation of diphones
GNU Affero General Public License v3.0
236 stars 58 forks source link

Configure voice search path #23

Open davidak opened 4 years ago

davidak commented 4 years ago

I'm packaging MBROLA for NixOS.

We don't use the linux FHS to be able to install multiple versions of the same package and practically solve the dependency hell problem that way. But that also means that we don't have /usr/share.

That often leads to problems with software that expects it.

[davidak@ethmoid:~/code/nixpkgs]$ espeak -v mb/mb-de1 "ich mag züge"
mbrola: FATAL ERROR : cannot find file /usr/share/mbrola/voices/de1 !
mbrowrap error: mbrola closed stderr and did not exit
Error: Could not load the specified mbrola voice file.

Can i set the path where MBROLA searches for voices using a CFLAG or something?

It can be one of these, depending on the installation method.

The best fix would be to search in XDG_DATA_DIRS for mbrola directory. That contains all the directories on NixOS.

The XDG Base Directory Specification says:

If $XDG_DATA_DIRS is either not set or empty, a value equal to /usr/local/share/:/usr/share/ should be used

valdisvi commented 4 years ago

eSpeak/eSpeak NG looks for MBROLA data files in following locations: /usr/share/mbrola/xx, /usr/share/mbrola/xx/xx, /usr/share/mbrola/voices/xx, where xx is name of particular language. If you see only single path (which may be misleading because only last path checked was shown) you are using eSpeak or old version of eSpeak NG, because newer version has more detailed error message.