程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> .NET網頁編程 >> .NET實例教程 >> 網上找到的VB語音識別程序

網上找到的VB語音識別程序

編輯:.NET實例教程

Option Explicit
Public WithEvents RC As SpSharedRecoContext
Public myGrammar As ISpeechRecoGrammar
             
Private Sub Form_Load()
    Set RC = New SpSharedRecoContext
    Set myGrammar = RC.CreateGrammar
    ''RC.Voice.GetVoices
             
    myGrammar.CmdLoadFromFile App.Path & "\command.XML", SLODynamic
    myGrammar.DictationSetState SGDSActive
End Sub
             
Private Sub RC_Recognition(ByVal StreamNumber As Long, ByVal StreamPosition As Variant, ByVal RecognitionType As SpeechLib.SpeechRecognitionType, ByVal Result As SpeechLib.ISpeechRecoResult)
    Select Case Result.PhraseInfo.GetText
    Case "上網"
        Shell "C:\Program Files\Internet Explorer\IEXPLORE.EXE"
    Case "開始"
        Shell "D:\Program Files\Tencent\QQ\QQ.exe"
    Case "音樂"
        Shell "D:\Program Files\TTPlayer\TTPlayer.exe"
    Case "下載"
        Shell "D:\Program Files\Thunder Network\Thunder\Thunder.exe"
    Case "BT下載"
        Shell "D:\Program Files\BitComet\BitComet.exe"
    ''Case "重啟"
   
    ''Case "關機"
       
    Case Else
        MsgBox "聽不懂你說什麼" & Result.PhraseInfo.GetText & ",再說一遍!"
    End Select
End Sub

 

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved