SpeechLib works fine in editor but not in runtime

Hey there.

I am trying to use SpeechLib to implement Text-To-Speech in Unity, it works fine in the editor but I get an exception when running a build on windows. Here is the error:

NotSupportedException: Specified method is not supported.
at System.__ComObject…ctor () [0x00006] in :0
at (wrapper cominterop) SpeechLib.SpVoiceClass…ctor()

Does anyone know how to fix it?

Thanks in advance!

For those facing the same problem, it was solved here: