Error '0x80045039' when using GetVoices method

1

I am getting an error "System.Runtime.InteropServices.COMException: 'Exception from HRESULT: 0x80045039'", when I use GetVoices method

my code:

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

    Dim SAPI

    SAPI = CreateObject("SAPI.SPVoice")


    SAPI.voice = SAPI.GetVoices.Item(0)
    SAPI.Speak("hello world)

End Sub

when removing the following line the code works fine:

API.voice = SAPI.GetVoices.Item(0)

I tried to run visual studio as administrator but I'm still getting this error.

vb.net
text-to-speech
sapi

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0