none
how to change speech language vb.net

All replies

  • Please explain your question in detail.  A post made with little to no effort is likely to receive the same kind of responses.

    At a minimum please tell us; do you want to specify the language of the text being interpreted, the speech spoken, or both?


    Reed Kimble - "When you do things right, people won't be sure you've done anything at all"

    Sunday, April 30, 2017 1:07 PM
    Moderator
  • Please explain your question in detail.  A post made with little to no effort is likely to receive the same kind of responses.

    At a minimum please tell us; do you want to specify the language of the text being interpreted, the speech spoken, or both?


    Reed Kimble - "When you do things right, people won't be sure you've done anything at all"

    Imports System.Speech
    
    Public Class Form1
        Dim WithEvents reco As New Recognition.SpeechRecognitionEngine
     
    
    
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    
    
            reco.SetInputToDefaultAudioDevice()
            Dim sb As New Recognition.SrgsGrammar.SrgsDocument
            Dim s As New Recognition.SrgsGrammar.SrgsRule("ar-eg")
            Dim colorsList As New Recognition.SrgsGrammar.SrgsOneOf("مرحبا")
            s.Add(colorsList)
            sb.Rules.Add(s)
            sb.Root = s
            reco.LoadGrammar(New Recognition.Grammar(sb))
            reco.RecognizeAsync()
        End Sub
        Private Sub sp(ByVal sender As Object, ByVal e As System.Speech.Recognition.RecognizeCompletedEventArgs) Handles reco.RecognizeCompleted
            reco.RecognizeAsync()
        End Sub
        Private Sub rrco_SpeechRecognized(ByVal sender As Object, ByVal e As System.Speech.Recognition.RecognitionEventArgs) Handles reco.SpeechRecognized
            Select Case e.Result.Text
    
    
                Case "مرحبا"
                    MsgBox("welcome")
    
            End Select
        End Sub
    
    
    
    
    
    End Class
    i want chabge lang to arabic
    Sunday, April 30, 2017 1:20 PM
  • You need to create the speech engine instance with the appropriate local specified:

    https://msdn.microsoft.com/en-us/library/ms554259(v=vs.110).aspx

    You'll also have to have an appropriate language engine installed in Windows and this is where you may run into an issue... I don't see any speech engine language options for Arabic.  It may be something you have to purchase from a 3rd party, or use a different speech engine which already supports the language.


    Reed Kimble - "When you do things right, people won't be sure you've done anything at all"

    Sunday, April 30, 2017 3:16 PM
    Moderator