none
{"Acesso negado. (Exceção de HRESULT: 0x80070005 (E_ACCESSDENIED))"} RRS feed

  • Pergunta

  • Estou tentando usar a speech para reconhecimento de voz algum tempo já e gostaria de saber o porque esta dando este erro como posso consertar ele obrigado desde já...

    aqui esta codigo que estou usando estou tentando um de exemplo que vi pela net 


    Imports System.Speech
    Imports System.Speech.Synthesis
    Imports System.Speech.Recognition
    Imports System.Threading
    Imports System.Globalization
    Imports System.IO
    
    
    
    Public Class Form1
    
        Public WithEvents recognizer As New System.Speech.Recognition.SpeechRecognitionEngine
    
        Dim gram As New System.Speech.Recognition.DictationGrammar()
    
        Public synth As New System.Speech.Synthesis.SpeechSynthesizer
        Dim cmd As Object
    
    
    
    
        Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    
            recognizer.LoadGrammar(gram)
    
            recognizer.SetInputToDefaultAudioDevice()
    
            recognizer.RecognizeAsync()
    
    
    
    
        End Sub
    
    
        
        Private Sub GotSpeech(ByVal sender As System.Object, ByVal phrase As System.Speech.Recognition.SpeechRecognizedEventArgs) Handles recognizer.SpeechRecognized
    
    
    
    
    
            If InStr(cmd, "run") Or InStr(cmd, "Run") Then
    
    
    
                If cmd.Split(" ")(1) = "Notepad" Or cmd.Split(" ")(1) = "notepad" Then
    
    
    
                    synth.Speak("Running Notepad.")
    
                    Shell("notepad.exe", AppWinStyle.NormalFocus, False)
    
    
    
                End If
    
    
    
            End If
    
    
    
        End Sub
    
    
    
    End Class
    


    quarta-feira, 23 de abril de 2014 02:54

Todas as Respostas

  • Estou tentando usar a speech para reconhecimento de voz algum tempo já e gostaria de saber o porque esta dando este erro como posso consertar ele obrigado desde já...

    aqui esta codigo que estou usando estou tentando um de exemplo que vi pela net 


    Imports System.Speech
    Imports System.Speech.Synthesis
    Imports System.Speech.Recognition
    Imports System.Threading
    Imports System.Globalization
    Imports System.IO
    
    
    
    Public Class Form1
    
        Public WithEvents recognizer As New System.Speech.Recognition.SpeechRecognitionEngine
    
        Dim gram As New System.Speech.Recognition.DictationGrammar()
    
        Public synth As New System.Speech.Synthesis.SpeechSynthesizer
        Dim cmd As Object
    
    
    
    
        Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    
            recognizer.LoadGrammar(gram)
    
            recognizer.SetInputToDefaultAudioDevice()
    
            recognizer.RecognizeAsync()
    
    
    
    
        End Sub
    
    
        
        Private Sub GotSpeech(ByVal sender As System.Object, ByVal phrase As System.Speech.Recognition.SpeechRecognizedEventArgs) Handles recognizer.SpeechRecognized
    
    
    
    
    
            If InStr(cmd, "run") Or InStr(cmd, "Run") Then
    
    
    
                If cmd.Split(" ")(1) = "Notepad" Or cmd.Split(" ")(1) = "notepad" Then
    
    
    
                    synth.Speak("Running Notepad.")
    
                    Shell("notepad.exe", AppWinStyle.NormalFocus, False)
    
    
    
                End If
    
    
    
            End If
    
    
    
        End Sub
    
    
    
    End Class


    Estou com o mesmo problema na linha 

    recognizer.LoadGrammar()

    Você conseguiu achar uma solução???

    domingo, 4 de outubro de 2020 15:18