PROGRAMMING LANGUAGE CEM AYGUN VOICE CONTROLLED LED LIGHT
The aim of this project is changing the led state by means of voice.I used red,white and yellow leds. PURPOSE
My codes consist of two main parts which are serial port and speech recognition.I used serial port to provide communication between C# and MSP430 CODES
comboBox1.DataSource = SerialPort.GetPortNames(); serialPort1.PortName = comboBox1.Text; serialPort1.Open(); serialPort1.BaudRate = 9600; textBox2.Text=Convert.ToString(serialPort1.BaudRate); serialPort1.Close(); SERIAL PORT USING
1)The language of your computer should be English or any supported language. 2)Your microphone should function properly 3)If you want to switch your camputer language as English.You can download Vistalizator from 4)Adding libraries and namespaces: -System.Speech; - using System.Speech.Synthesis; -using System.Speech.Recognition; REQUIREMENTS TO USE SPEECH FEATURE
GLOBAL VARIABLES: SpeechRecognitionEngine speechrecognizer=new SpeechRecognitionEngine(new System.Globalization.CultureInfo("en-US")); SpeechSynthesizer voice = new SpeechSynthesizer(); LOAD GRAMMAR METHOD: Choices choices = new Choices(); choices.Add("red", "white", "white off", "yellow", "cem", "aygun", "red off", "yellow off"); GrammarBuilder grammarBuilder = new GrammarBuilder(choices); Grammar grammar = new Grammar(grammarBuilder); speechrecognizer.LoadGrammar(grammar); SPEECH CLASS
speechrecognizer.SpeechDetected += new EventHandler (sestaniniyor); speechrecognizer.SpeechRecognitionRejected += new EventHandler (sestanimlanamadi); speechrecognizer.SpeechRecognized += new EventHandler (sestanindi); speechrecognizer.SetInputToDefaultAudioDevice(); speechrecognizer.RecognizeAsync(RecognizeMode.Single); CONTINUE
private void sestanindi(object sender, SpeechRecognizedEventArgs tanima) { if (tanima.Result.Text == "yellow") { panel3.Visible = true; panel3.BackColor =Color.Yellow; serialPort1.Write("Y"); voice.Speak("yellow turns on"); } CONTINUE if (tanima.Result.Text == "yellow off") { panel3.Visible = false; serialPort1.Write("y"); voice.Speak("yellow turns off"); }
private void sestanimlanamadi(object sender, SpeechRecognitionRejectedEventArgs e) { textBox1.Text = "Ses Tanima İslemi Basarisiz. "; } CONTINUE
- us/library/office/hh361683(v=office.14).aspx - ardiuno-using-visual.html - REFERANCES
ANY QUESTIONS??
THANK YOU FOR LISTENING!