Search code examples
unity-game-enginespeech

Unity: SpeechLib works fine in editor but not in runtime


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!


Solution

  • I found the solution.

    Steps:

    1. Build Settings
    2. Player Settings
    3. Make sure you selected "Standalone" tab
    4. Open "Other Settings" tab
    5. Api Compatibility Level: choose .Net 4.x
    6. Save and build