I was checking every on the internet to get some input from my microphone into VB, but unfortunately I didn't find anything. So decided to head back and check all the libraries that Microsoft has already provided and something caught my eye... something related.
Speech... Speech... Speech...
Okay as for the actually tutorial, heres what you're going to do. Start a new windows application project in VB and add the following reference:
And now you have to import it.
Code:
Imports System.Speech.Recognition
Okay now that you've done that, you're going to create an instance of the class were going to use.
Code:
Private SR As New SoundRecognizer
Which is basically this...
The class we just imported is just the representation of the windows speech recognizer software. Which means that it also depends on it. So start the WPR if you haven't yet. Now lets get some input. Per say... the level the of input (the intensity) to a progress bar using a timer.
Code:
Private Sub Timer1_Tick() Handles Timer1.Tick
ProgrressBar1.Value = SR.AudioLevel
End Sub
And now you notice that when you scream into your microphone the value of the progress bar sky rockets... which means you own a microphone which also works. I don't really know what the other functions in the class do... so just test them all out for your sake.
Extra:
Heres what you can do, check if the person is screaming loud enough you can do something.
Code:
If ProgressBar1.Value = 100 Then
Me.Close
End Sub
Pretty useless, but it's a cool way to make the person close the application. Oh and don't forget to post some code if you figure something new with the API.