Published: Mon Dec 28 09:36:36 2015
Topic: How to use MBROLA voices with NVDA screen reader
Author: Dalen
Version: 1.0
Viewed: 6677 times
Rated: 12 times
Score: 52 {This howto *Exceeds Expectations* with average 4.3}
Questions: 133
Answers: 2

This howto article offers 3 possible solutions that will allow you to use MBROLA voices with free screen reader NVDA (non-visual desktop access).
Article either provides references to instructions on how to set up such environment or lists the steps themselves.
It also lists pross and cons for each one.

Using MBROLA voices through MS SAPI5 and eSpeak synthesizer

eSpeak is a compact, cross-platform, open source software speech synthesizer for English and other languages. eSpeak uses a "formant synthesis" method. This allows many languages to be provided in a small size. The speech is clear, and can be used at high speeds, but is not as natural or smooth as larger synthesizers which are based on human speech recordings.
However, it can be extended with MBROLA dyphone databases which are based on human speech recordings, and with MBROLA synthesizer itself.
MBROLA is not a real speech engine, it is only a speech synthesizer that has to be instructed on how to produce the speech.
When used with eSpeak, eSpeak provides these informations to MBROLA and MBROLA does the synthesis.
The main problem with this approach is that informations about prosody (duration, pitch and intensity of each produced phoneme) is tuned to work with eSpeak's formant synthesis system.
eSpeak-MBROLA interwork causes problems when used in some languages. English sounds pretty good.
But Croatian, for instance, sounds very snatchy. This is very irritating, especially for people who are use to that particular voice sounding well on their mobile phones.
eSpeak can be used with MS SAPI5 service. This means that it can be used with any screen reader that supports SAPI5 and nearly all of them do. NVDA supports it too.
This also means that any MBROLA voice installed to work with eSpeak can be available to NVDA through SAPI5.
Problem 1:
* Some languages sounds odd
Problem 2:
* eSpeak itself sounds different when used with SAPI5 than when used alone through command line or directly from NVDA.
  + Do I need to mention that this influences how MBROLA voices sound too? I think this should be obvious by now.
Problem 3:
* eSpeak can register only 6 languages to SAPI5.
  + Do not forget eSpeak supports over 25 languages and MBROLA does too.
Problem 4:
* There might be issues when more than one application tries to use SAPI5 at once, let alone the same voice within it.
  + For those that use parallelly another screen reader along with NVDA, that might pose a serious problem.

To arrange described setup you have to:
1. Download eSpeak for SAPI5 installer from its official repository espeak.sourceforge.net
2. Download MBROLA tools and voice database you wish to use from MBROLA site or its mirrors tcts.fpms.ac.be/synthesis/mbrola.html
3. Install MBROLA tools
4. Install eSpeak for SAPI5
   When asked to enter voices to use add MBROLA voice(s) using mb prefix.
   E.g. If you decided to use en1 MBROLA database, enter mb-en1.    Do not try to use this voice before following the next step.
5. Copy the downloaded MBROLA database,, only the file, not whole unzipped directory, to the espeak-data/mbrola folder that you will find inside a folder where you installed eSpeak.
   This would usually be: C:\Program Files\eSpeak
If you already have eSpeak installed, you will have to follow steps four and five. There is no other secure way of registering the newly added MBROLA voice to SAPI5.

A little more on the subject can be read on eSpeak site espeak.sourceforge.net/mbrola.html

I trust you know that NVDA comes bundled with eSpeak synthesizer, so why on Earth would we need to use SAPI5 version if we can add mbrola voices to NVDA's eSpeak?
It is not very complicated, no. Changes you should apply are similar to those described above. Then why wouldn't I explain more?
Let say that I do not like this method because number of reasons. One of which is that when people wish to do that, they also want to do the same for the portable version of NVDA.
Which may lead to number of unwanted complications that a user who is not computer freak wouldn't like at all.
This brings us to method that will achieve the same thing in an user-friendly way and with less necessary steps.

Using MBROLA voices through "Mbrola in Espeak" NVDA add-on by datajake

This add-on allows you to use MBROLA with eSpeak directly from NVDA. It can be found at:
http://grossgang.com/tts/synthesizers%20for%20nvda/
Just find the link and download the add-on. In order to work correctly you should have MBROLA tools installed.
When it is not there or some problem occurs eSpeak will be used instead of MBROLA voices.
The add-on comes with MBROLA voices so MBROLA tools and the add-on are enough.
Installing add-ons is very easy and it is described in short at: https://www.coolblindtech.com/an-introduction-to-nvda-installing-add-ons/
After installing it, just choose it in NVDA menu --> Preferences --> Synthesizer.
This add-on suffers from same flaws as when MBROLA is used with eSpeak SAPI5 version.
The exception is slightly better sounding voices, because eSpeak SAPI5 versions are, as I said above, a little different from eSpeak default ones.
Add-on also has some bugs. For example when there is more than one voice of the same language, but using different MBROLA voice, like US English us1, us2, and us3, you can choose only first and others, although listed, will use that voice.
So, us1, us2, us3 will all be us1. which is a female voice.
Also, sometimes it flicks back to eSpeak for no valid reason which sounds scary because activated eSpeak voice keeps settings for MBROLA one.
eSpeak for SAPI5 at least doesn't do that.
Good side of this module is that it offers much easier installation process and better portability.
I.e. you may easily use it with portable version of NVDA under condition that MBROLA tools is installed on machine you are running NVDA on.
It can also be adapted to carry mbrola.dll along with itself which will allow you to use this add-on without MBROLA tools being installed.

The greatest down side of these two methods is the MBROLA licence dialog.
When MBROLA synthesizer is used for the first time in a user session, it displays a dialog containing MBROLA licence.
The trouble is that until you click I Agree, you cannot continue with your work .
This means that when you log into your account and start NVDA and try to use MBROLA voice NVDA will block until you click I Agree.
What is worst, this MBROLA dialog sometimes gets out of focus, so pressing just enter doesn't garantee you a success.
You'd say, well, then restart NVDA using a shortcut key and everything will work correctly.
Hm, sometimes yes, more often no. And MBROLA licence dialog will stay on, covering your screen, and NVDA will not even tell you it is there.
It won't be focused and only hope you have to get rid of it is either to navigate with mouse to it and try clicking I Agree.
NVDA will detect it and its text under the mouse. Or use task manager to switch to it and then try to Agree, or try to kill it.
Believe me, it is a complete mess. You may end with the licence window whole time staying on without knowing that it is there, and interfering with your work.
You will notice that some things are not read correctly and that some things won't activate when you click them, etc. etc., and everything will be caused by this stupid licence window.
I'd say this appearance is very undesirable.

I present now a third way of using MBROLA voices with NVDA.

Using Mbrolax Text To Speech Engine with NVDA

Mbrolax is a text to speech engine that uses MBROLA synthesizer, but creates the pronunciation informations itself, without help from eSpeak or any other software.
One of its forms is Mbrolax NVDA add-on. It comes with four voices and mbrola.dll bundled in, so no need to install anything but the add-on.
This makes it suitable for running with portable versions of NVDA as well as installed ones.
The licence dialog problem is also solved. When Mbrolax is selected as a NVDA synthesizer Mbrolax starts speaking as soon as possible. Nothing blocks because of the licence dialog.
The licence dialog is shown and it is properly focused and its presence is announced. User is able to agree or disagree with the licence.
If user somehow succeeds in losing focus over the window and is unable to regain it, there is no place for panic. The window will remove itself automatically after two minutes.
Of course the naughty licence window appears only when MBROLA is used first time per user session.
Visit the above linked Mbrolax page, where you can read more about it, and download Mbrolax NVDA add-on.
Install it and you are ready to go.
Mbrolax comes with Croatian, British English, US English (us1) and US English (us2) voices.
Other voices are in making. The author garantees further development of Mbrolax and more voices.
Negative sides and bugs of Mbrolax are listed on its home page, so no point repeating them.

If you want to decide yourself which solution is best, you can safely apply all three at once. They will not mix nor interfere with eachother.
Then you will be able to pick one you like best or use them all. Why not?


Please, rate this howto to let other users know whether it is worth reading it or not. Just click on a grade you wish to appoint.
No rate (0) | Troll (1) | Dreadful (2) | Acceptable (3) | Exceeds Expectations (4) | Outstanding (5)

Hide questions and answers!
To ask your own question scroll down or hide Q&A to reach the form quickly.

On Mon Jan 4 16:24:28 2016 Timon asked:
      Hi, nice article. I've tested the three options. Unfortunately the third option doesn't have al languages yet. The other 2 have the License dialog "problem". In the package of Mbrolax there's an exe file MBR_ShowLicense. Would it be possible to use this exe file for option 1 en 2?
      (maybe start it automatically with startup items?)
      I've tried, but the license seems to stay active until I close the command-line window.
Dalen's answer:
      Hi Timon,
      Yes, it is possible to apply the same system to both first and second option.
      Mbrolax TTS uses MBR_Showlicence.exe to activate the synthesizer and do nothing else.
      If this is the first call to mbrola.dll in current user session the licence dialog appears and MBR_ShowLicence.exe blocks until you click I Agree or quit the console window, as you noticed, if is not, MBR_ShowLicence.exe will just close when started.
      Mbrolax module that does the actual job of calling MBR_ShowLicence.exe in a proper manner, and then focusing the dialog is called licence.py, and it is already open-source.
      Which means that you can take it and use it in mbrolaInEspeak as both are written in Python.
      To do this you have to copy MBR_ShowLicence.exe and licence.py from the Mbrolax add-on to mbrolaInEspeak add-on.
      Then edit the mbrolaInEspeak to use the licence module.
      Go to your users application data folder, and then browse to nvda\addons\mbrolaInEspeak\synthDrivers.
      Copy the licence.py and MBR_ShowLicence.exe there.
      Then open there present file mbrolaInEspeak.py with notepad and add two following lines after the last import, just before the line starting with class.
      import licence
      licence.show()
      save the changes, restart NVDA, and if it is not already chosen, choose the mbrolaInEspeak as a synthesizer.
      If it is not present in list of synthesizers then you made some mistake.
      Note that licence is here always spelled with two "c" characters, not with "s" before "e".
      To apply the method on SAPI5 solution is not so easy nor neat.
      Using your suggestion you would need two processes registered to startup items.
      First would be MBR_ShowLicence.exe, second a program or batch file that would deal focusing to dialog and/or closing MBR_ShowLicence.exe.
      Ideally you would have Python interpreter installed on your machine and register licence.py to your startup items. That would do the trick.
      But I won't enter into details now.
      I will consider making an exe package for startup that would enable mbrola to be always used without problems for any synthesizer using mbrola.dll.
      When I do, I'll post a howto here.

Hide questions and answers!

Ask the author a question about the article you just read.
You may expect an answer appearing on this page below the article, inside the article itself or sent to you directly via e-mail if you provide one.