Found an issue in a Microsoft.Speech.dll that causes critical failure upon initializing SpeechRecognitionEngine

Anonymous
2024-05-21T15:58:13+00:00

While trying to use Microsoft.Speech.dll from, I found that SpeechRecognitionEngine cannot correctly obtain RecognizerInfo of installed recognizers from Windows registry.

I have used these sources:

-SDK: https://www.microsoft.com/en-us/download/details.aspx?id=27226

-Runtime: https://www.microsoft.com/en-us/download/details.aspx?id=27225

-Language packs: https://www.microsoft.com/en-us/download/details.aspx?id=27224

I've tried to initialize SpeechRecognitionEngine via empty constructor and with CultureInfo and this causes NullReferenceException.

Same thing for SpeechRecognitionEngine.InstalledRecognizers() method.

Then I drove into the dll code and found IntPtr HKEYfromRegKey(RegistryKey regKey) method causes an error.

After some debugging I found that this reflection call causes an error:

FieldInfo field = typeFromHandle.GetField("hkey", bindingAttr);

It seems that here you trying to get field that does not exist in RegistryKey class.

Reason: "hkey" must be "_hkey" because RegistryKey class have respective field member: SafeRegistryHandle _hkey.

After restarting this works.

Microsoft.Speech.dll mainteners, **** please fix this or investigate further because dll just don't work as expected and can be used only with some workarounds that does not fulfill declared functionality.

Windows for business | Windows Server | User experience | Remote desktop services and terminal services

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question. To protect privacy, user profiles for migrated questions are anonymized.

0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Anonymous
    2024-05-22T01:43:19+00:00

    Hello,

    We apologize, but under the Windows Server / User Experience category, we primarily handle issues related to Remote Desktop Services and printing. Your issue appears to be more development-related. Developers may not see your post here.

    We highly recommend posting this issue in a more relevant forum:

    You may try:

    1.GitHub: Some Microsoft projects are open-sourced and hosted on GitHub. While Microsoft.Speech might not be directly open-source, it's possible related components or samples are on GitHub. Look for relevant repositories and check if they have an "Issues" tab where you can report the problem.

    2.Microsoft Q&A: Microsoft supported products on Q&A | Microsoft Learn You can post your issue there to seek help from other developers who may have encountered similar problems.

    3.Microsoft Feedback Hub: You can use the built-in Feedback Hub app to report issues. This is more consumer-focused, but it's worth a try if the issue affects end-users.

    4.Stack Overflow: This is a highly active community of developers. Stack Overflow

    Regards,

    Karlie

    0 comments No comments
  2. Anonymous
    2024-06-11T17:59:29+00:00

    Hello,

    Unfortuantely, there is no open-source githab for this project. Also, there is no available option to contact someone

    who maintains this dll, for me at least none of these seems to be. But anyway, Karlie, thanks for your support.

    Regards,

    Oleksander

    0 comments No comments
  3. Anonymous
    2024-06-11T18:03:58+00:00

    If anyone have this problem, you can either deobfuscate dll and rebuild it with this fix as your own version or

    use this patched version from ladenedge:

    https://github.com/ladenedge/Verint.Microsoft.Speech

    It already contains this fix and is available on Nuget.

    0 comments No comments