Author Topic: Installing (additional) SAPI speech recognition engines  (Read 144 times)

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4644
  • RTFM
Installing (additional) SAPI speech recognition engines
« on: May 08, 2024, 09:11:26 AM »
VoiceAttack requires the SAPI speech recognition system components that are part of Windows itself to be in working order.

This guide is especially relevant if VoiceAttack is showing an error message when it's started (though note that not all such error messages are caused by this specific issue).

One such error message could contain "Object reference not set to an instance of an object." followed by "at System.Speech.Recognition.SpeechRecognitionEngine.InstalledRecognizers()" (these messages are localized for the Windows display language you're using, so will be partially different for non-English Windows installations)


The following languages should, at the time of writing, have a working SAPI speech recognition engine made available for them by Microsoft:
Chinese (Simplified, China)
Chinese (Traditional, Hong Kong SAR)
Chinese (Traditional, Taiwan)
English (United Kingdom)
English (United States)
Français (France) / French (France)
Deutsch (Deutschland) / German (Germany)
Japanese
Español (España) / Spanish (Spain)

If the language you intended for speech recognition is not listed above, and your Windows installation is not in one of the listed languages, but an error message is shown when attempting to start VoiceAttack, follow this guide using "English (United States)", as at least one language likely needs to be installed in order for VoiceAttack to be able to start.

Languages not listed above may have a Speech Platform 11 speech recognition engine available, which VoiceAttack can use with certain caveats. Click here for more information regarding that alternate speech recognition system.
Again, note that at least one of the above languages likely needs to be installed in order for VoiceAttack to be able to start; installing Speech Platform 11, if applicable, can be done after completing the steps in this guide.

Follow these steps:
  • Open the Windows Settings app, E.G. by holding the Windows key on your keyboard and pressing the "i" key, or by opening the Windows Start menu and clicking the cog/gear icon.

  • In the Settings app, on the left-hand side, click "Time & language"


  • On the "Time & language" page, click "Language & region"


  • On the "Language & region" page, under "Preferred languages", there should be a list of the languages currently installed for your Windows installation (usually this will only contain one entry: the language Windows was installed in)


    If the language you would like to use for speech recognition (or are installing because of an error message) is listed near the top of this post and already listed under "Preferred languages", click here to jump to the relevant steps.

    If the language you would like to use for speech recognition (or are installing because of an error message) is listed near the top of this post, but not listed under "Preferred languages", continue with the next step, step 5.

  • Click the "Add a language" button


  • On the "Choose a language to install" dialog, find the language you want to use (again, it must be one of those listed near the top of this post), either by typing its name into the search field near the top of the dialog, or by manually scrolling and finding it in the list.

  • Click the language you'd like to use to select it (there should be a vertical bar shown to the left-hand side of the language listing to show that it's selected), then click the "Next" button.

  • Configure the "Install language features" dialog as follows:
    Make sure "Language pack", "Text-to-speech", and "Basic speech recognition" have the box to the left-hand side of them checked.
    Optionally, "Enhanced speech recognition" and "Handwriting" can be checked, however neither of those are relevant to SAPI speech recognition. I.E. "Enhanced speech recognition" is not relevant to VoiceAttack; it refers to a completely separate speech recognition system.
    Make sure "Set as my Windows display language" also has the box to the left-hand side of it checked. This will change the language your Windows installation uses, which is necessary for training the speech recognition system. After training this can be changed back to your preferred language.


  • Finally, click "Install"

  • Your chosen language should now be installed. On the "Language & region" page, make sure the "Windows display language" option is set to the same language you intend to use for speech recognition. As mentioned, this is necessary for training the speech recognition system.
    When you are finished with the training, you can use the "Windows display language" option to change the language your Windows installation uses back to your preferred language. Do note that if you want to perform additional training in the future, this option will again need to be changed to match the speech recognition language.


  • Now you can close the Windows Settings app, and start VoiceAttack.

    If an error message still appears when starting VoiceAttack, click here to jump to the relevant steps.

    If VoiceAttack now starts successfully, you'll want to make sure to complete the speech recognition training at least three times. Instructions for starting that training can be found here.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4644
  • RTFM
Re: Installing (additional) SAPI speech recognition engines
« Reply #1 on: May 08, 2024, 09:11:39 AM »
The following is relevant only if the language you would like to use for speech recognition (or are installing because of an error message) is listed near the top of this post and already listed under "Preferred languages" in the Windows Settings app

Step 01 should follow step 4 from the first post in this topic
  • Click the "..." icon to the right-hand side of the language description


  • Click "Language options"


  • If the "Speech recognition" section is not open by default, click it to expand it.

  • If a "Download" button is present to the right-hand side of the "Basic speech recognition" label, click that button to download the speech recognition components. After downloading the components, "Installed" should be shown instead of the button.
    Note that "Enhanced speech recognition" is not relevant to VoiceAttack (this is not part of the SAPI speech recognition system), so if there is a download button to the right-hand side of that label there is no need to click that.


  • On the "Language & region" page, make sure the "Windows display language" option is set to the same language you intend to use for speech recognition; this is necessary for training the speech recognition system.
    When you are finished with the training, you can use the "Windows display language" option to change the language your Windows installation uses back to your preferred language. Do note that if you want to perform additional training in the future, this option will again need to be changed to match the speech recognition language.

  • Now try starting VoiceAttack again.

    If an error message still appears when starting VoiceAttack, or If the "Download" button was not present next to the "Basic speech recognition" label and instead "Installed" is already shown, but you're seeing an error message, click here to jump to the relevant steps.

    If VoiceAttack now starts successfully, you'll want to make sure to complete the speech recognition training at least three times. Instructions for starting that training can be found here.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4644
  • RTFM
Re: Installing (additional) SAPI speech recognition engines
« Reply #2 on: May 08, 2024, 09:11:48 AM »
The following is relevant only if an error message is still shown after installing an appropriate language

In rare cases, Windows will fail to install the speech recognition components correctly, which will lead to VoiceAttack (still) showing an error message, and not starting further.
If you encounter this, first make sure VoiceAttack is closed (including any error message dialogs), then try searching the Windows Start menu for "Windows Speech Recognition", and start that application.
If that application starts successfully, try starting VoiceAttack again.
Note that the Windows Speech Recognition application does not need to, and is not recommended to be running alongside VoiceAttack. Starting the application once should be enough for it to repair the components not being installed correctly.

Note that the application you're looking for should look like this in the Windows Start menu (note the old-fashioned icon style):


If searching for "Windows Speech Recognition" does not bring up that specific application, your system is missing certain speech recognition components.
Unfortunately there is no known remedy specifically for this, as Microsoft does not provide tools to repair this type of issue with the speech recognition components. Reinstalling Windows itself is the only known method (doing so would be at your own risk).

Note that Microsoft plans to remove the "Windows Speech Recognition" application, but has, at the time of writing, not specified when this will occur. As mentioned, this application is not needed under normal circumstances for VoiceAttack to work, as the underlying SAPI components should still remain available. However it does mean that when Windows fails to install the components correctly, the only remaining remedy is reinstalling Windows itself (again, this would be at your own risk).