private void TwitterCheck_Tick(object sender, EventArgs e) { /* MailReader rep = new MailReader("imap.gmail.com", 993, true, @"*****@*****.**", "piczorocks101"); //Text to Command * foreach (ActiveUp.Net.Mail.Message email in rep.GetUnreadMails("JarvisCommand")) * { * System.IO.File.WriteAllText(@"C:\Users\nick\Documents\Visual Studio 2012\Projects\Jarvis V2\Jarvis V2\bin\Debug\Data\email.txt", email.BodyText.TextStripped); * // Response.Write(string.Format("<p>{0}: {1}</p><p>{2}</p>", email.From, email.Subject, email.BodyHtml.Text)); * //command.processCommand(email.BodyHtml.Text, this); * } */ t1.TwitterLoad(); //Tweet to command JarvisData.load(); if (JarvisData.lastTweet != Twitter.LatestTweet) { command.processCommand(Twitter.LatestTweet, this); } JarvisData.lastTweet = Twitter.LatestTweet; JarvisData.save(); this.log.Items.Add(Twitter.LatestTweet + "- Twitter Feed"); if (log.Items.Count > 50) { log.Items.Clear(); } }
public MainWindow() { InitializeComponent(); JarvisData.load(); clockTimer.Tick += clockTimer_Tick; clockTimer.Interval = 1000; clockTimer.Start(); // TwitterCheck.Tick += TwitterCheck_Tick; // TwitterCheck.Interval = 2000; // TwitterCheck.Start(); sleepTimer.Tick += sleepTimer_Tick; sleepTimer.Interval = 300000; sleepTimer.Start(); _recognizer.SetInputToDefaultAudioDevice(); build.AppendDictation(); finalGrammar = new Grammar(build); _recognizer.LoadGrammar(finalGrammar); _recognizer.SpeechRecognized += new EventHandler <SpeechRecognizedEventArgs>(Commands); _recognizer.RecognizeAsync(RecognizeMode.Multiple); }
void Commands(object sender, SpeechRecognizedEventArgs e) //Voice to command { if (e.Result.Text.StartsWith("jarvis")) { JarvisData.isOff = "false"; JarvisData.save(); } command.processCommand(e.Result.Text, this); JarvisData.load(); }
//SpeechSynthesizer JARVIS = new SpeechSynthesizer(); public MainWindow() { InitializeComponent(); haarCascade = new HaarCascade(@"haarcascade_frontalface_alt_tree.xml"); capture = new Capture(); JarvisData.load(); clockTimer.Tick += clockTimer_Tick; clockTimer.Interval = 1000; clockTimer.Start(); TwitterCheck.Tick += TwitterCheck_Tick; TwitterCheck.Interval = 2000; TwitterCheck.Start(); TwitterCollectorTimer.Tick += TwitterCollectorTimer_Tick; TwitterCollectorTimer.Interval = 1800000; TwitterCollectorTimer.Start(); facialRecTimer.Tick += facialRecTimer_Tick; facialRecTimer.Interval = 1000; facialRecTimer.Start(); //capture.QueryFrame(); // autoSave.Tick += autoSave_Tick; // autoSave.Start(); // autoSave.Interval = 10000; if (JarvisData.isMiniMic.Contains("true")) { this.micLabel.Content = "Mic: Mini Mic"; } else { this.micLabel.Content = "Mic: Kinect"; } _recognizer.SetInputToDefaultAudioDevice(); build.AppendDictation(); finalGrammar = new Grammar(build); _recognizer.LoadGrammar(finalGrammar); _recognizer.SpeechRecognized += new EventHandler <SpeechRecognizedEventArgs>(Commands); _recognizer.RecognizeAsync(RecognizeMode.Multiple); }
private void TwitterCheck_Tick(object sender, EventArgs e) { t1.TwitterLoad(); //Tweet to command JarvisData.load(); if (JarvisData.lastTweet != Twitter.LatestTweet) { command.processCommand(Twitter.LatestTweet, this); } JarvisData.lastTweet = Twitter.LatestTweet; JarvisData.save(); this.log.Items.Add(Twitter.LatestTweet + "- Twitter Feed"); if (log.Items.Count > 50) { log.Items.Clear(); } }
void Commands(object sender, SpeechRecognizedEventArgs e) //Voice to command { command.processCommand(e.Result.Text, this); JarvisData.load(); }