[HowTo] Make a J.A.R.V.I.S System [VB.NET]

09/21/2013 10:06 NoCheatImPGM#1
J.A.R.V.I.S



You will need to create a text document and put all your commands !


1) Imports

Quote:
Imports System.Speech.Recognition
Imports System.Speech.Recognition.SrgsGrammar
Imports System.Runtime.InteropServices
Imports System.IO
Imports System.Reflection
2) Declare

Quote:
Private recognizer As SpeechRecognizer
Dim QuestionEvent As String
Dim Jarvis = CreateObject("Sapi.spvoice")
3) Settings

Quote:
Public Sub New()

InitializeComponent()

recognizer = New SpeechRecognizer()
AddHandler recognizer.SpeechDetected, AddressOf recognizer_SpeechDetected
AddHandler recognizer.SpeechRecognitionRejected, AddressOf recognizer_SpeechRecognitionRejected
AddHandler recognizer.SpeechRecognized, AddressOf recognizer_SpeechRecognized

Dim grammar As New GrammarBuilder()
grammar.Append(New Choices(System.IO.File.ReadAllLines("Commands.txt" )))
recognizer.LoadGrammar(New Grammar(grammar))

End Sub
4) A small Code

Quote:
Private Sub recognizer_SpeechRecognized(ByVal sender As Object, ByVal e As SpeechRecognizedEventArgs)
Dim Random As New Random
Dim Number As Integer = Random.Next(1, 10)
Select Case e.Result.Text.ToUpper
Case Is = "SPEAKING" ' Here you must put the text in capitals letter!
Jarvis.speak("And i can answer you sir !") 'Now J.AR.V.I.S is speaking ... Amazing !
End Select
End Sub
[Only registered and activated users can see links. Click Here To Register...]
_________________________

Now you can turn on J.A.R.V.I.S
If you get any problem please say it here. Good luck ! :)

-NoCheatImPGM
09/21/2013 14:31 Jay Niize#2
This is not a tutorial. This is just a Sourcecode. Please tell something about the code. Otherwise this thread will be closed.
09/25/2013 15:27 Shawak#3
Code:
Private Sub recognizer_SpeechRecognized(ByVal sender As Object, ByVal e As SpeechRecognizedEventArgs)
Dim Random As New Random
Dim Number As Integer = Random.Next(1, 10)
Select Case e.Result.Text.ToUpper
Case Is = "SPEAKING" ' Here you must put the text in capitals letter!
Jarvis.speak("And i can answer you sir !") 'Now J.AR.V.I.S is speaking ... Amazing !
End Select
End Sub
So what is 'random' and 'number' for?
09/26/2013 20:27 qkuh#4
Nothing I guess.
10/02/2013 20:59 NoCheatImPGM#5
Sorry, it was a small option with a random answer.

Regards, PGM.