Asked by:
UWP vb speech recognizer

Question
-
How can you make it simple speech recognizer.I have this:
Imports Windows.Media.SpeechRecognition
Public NotInheritable Class MainPage
Inherits Page
Dim voice As New SpeechRecognizer()
Private Sub Grid_Loaded(sender As Object, e As RoutedEventArgs)
TextBox1.Text = voice.RecognizeAsync.ToString
End Sub
Private Sub Buton1_Click(sender As Object, e As RoutedEventArgs) Handles Buton1.Click
End Sub
End Classhow to improve it
- Moved by Julie Xu-MSFTMicrosoft contingent staff Thursday, December 12, 2019 6:31 AM UWP
Sunday, December 1, 2019 8:20 AM
All replies
-
Hi,
There is a small example and it comes from here. The results of the operation vary depending on the microphone, ambient noise, room acoustics, and microphone placement. Voice recognition training is also available in the control panel.
Option Strict On Imports System.Speech ' Add reference, Assemblies, Framework, System.Speech Imports System.Speech.Recognition Public Class Form1 Public synth As New Speech.Synthesis.SpeechSynthesizer Public WithEvents Recognizer As New Speech.Recognition.SpeechRecognitionEngine Dim gram As New System.Speech.Recognition.DictationGrammar() Public Sub GotSpeech(ByVal sender As Object, ByVal phrase As System.Speech.Recognition.SpeechRecognizedEventArgs) Handles Recognizer.SpeechRecognized TextBox1.Text += phrase.Result.Text + "" End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Recognizer.LoadGrammar(gram) Recognizer.SetInputToDefaultAudioDevice() Recognizer.RecognizeAsync(Recognition.RecognizeMode.Multiple) End Sub End Class
Some people have asked similar questions before, and I think the suggestions here will be of great value to you.
You can also check out the MSDN sample documentation as follows.
https://docs.microsoft.com/en-us/archive/msdn-magazine/2014/december/voice-recognition-speech-recognition-with-net-desktop-applications
Best Regards,
MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
- Edited by Julie Xu-MSFTMicrosoft contingent staff Monday, December 2, 2019 5:56 AM
Monday, December 2, 2019 5:51 AM -
But I don't use forms only pages(uniwersal windows platform). Then the code is different. Documentation msdn.miocrosoft applies only to C # I use VB. Despite everything thank you for your interest.Monday, December 2, 2019 2:39 PM
-
Hello,
Sorry, I originally thought your problem was only with VB.NET. Our forum only deals with issues related to VB.NET not involve UWP. I'm sorry, your issue involves UWP, so I suggest you go to the following forums for help:
https://docs.microsoft.com/answers/index.html
Hope it help to you .
Thank you for participating in the forum activities.
Best Regads,
MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
- Edited by Julie Xu-MSFTMicrosoft contingent staff Wednesday, December 4, 2019 1:54 AM
Tuesday, December 3, 2019 1:24 AM