PROGRAMMING LANGUAGE CEM AYGUN 2010514008 VOICE CONTROLLED LIGHT
- Slides: 13
PROGRAMMING LANGUAGE CEM AYGUN 2010514008 VOICE CONTROLLED LIGHT
PURPOSE Ø The aim of this project is changing the led state by means of voice. I used red, white and yellow leds.
CODES Ø My codes consist of two main parts which are serial port and speech recognition. I used serial port to provide communication between C# and MSP 430
SERIAL PORT USING combo. Box 1. Data. Source = Serial. Port. Get. Port. Names(); serial. Port 1. Port. Name = combo. Box 1. Text; serial. Port 1. Open(); serial. Port 1. Baud. Rate = 9600; text. Box 2. Text=Convert. To. String(serial. Port 1. Baud. Rate); serial. Port 1. Close();
REQUIREMENTS TO USE SPEECH FEATURE 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 http: //www. froggie. sk/ 4)Adding libraries and namespaces: -System. Speech; - using System. Speech. Synthesis; -using System. Speech. Recognition;
SPEECH CLASS GLOBAL VARIABLES: Speech. Recognition. Engine speechrecognizer=new Speech. Recognition. Engine(new System. Globalization. Culture. Info("en-US")); Speech. Synthesizer voice = new Speech. Synthesizer(); LOAD GRAMMAR METHOD: Choices choices = new Choices(); choices. Add("red", "white off", "yellow", "cem", "aygun", "red off", "yellow off"); Grammar. Builder grammar. Builder = new Grammar. Builder(choices); Grammar grammar = new Grammar(grammar. Builder); speechrecognizer. Load. Grammar(grammar);
CONTINUE speechrecognizer. Speech. Detected += new Event. Handler<Speech. Detected. Event. Args>(sestaniniyor); speechrecognizer. Speech. Recognition. Rejected += new Event. Handler<Speech. Recognition. Rejected. Event. Args>(sestanimlanamadi); speechrecognizer. Speech. Recognized += new Event. Handler<Speech. Recognized. Event. Args>(sestanindi); speechrecognizer. Set. Input. To. Default. Audio. Device(); speechrecognizer. Recognize. Async(Recognize. Mode. Single);
CONTINUE private void sestanindi(object sender, Speech. Recognized. Event. Args tanima) { if (tanima. Result. Text == "yellow") { panel 3. Visible = true; panel 3. Back. Color =Color. Yellow; serial. Port 1. Write("Y"); voice. Speak("yellow turns on"); } if (tanima. Result. Text == "yellow off") { panel 3. Visible = false; serial. Port 1. Write("y"); voice. Speak("yellow turns off"); }
CONTINUE private void sestanimlanamadi(object sender, Speech. Recognition. Rejected. Event. Args e) { text. Box 1. Text = "Ses Tanima İslemi Basarisiz. "; }
REFERANCES -http: //msdn. microsoft. com/enus/library/office/hh 361683(v=office. 14). aspx -www. georgehk. blogspot. com. tr/2014/05/turn-onoff-led-inardiuno-using-visual. html -http: //www. burakozkan. net/c-serial-port-bileseni/
ANY QUESTIONS? ?
THANK YOU FOR LISTENING!
- Zeynep ıssı
- Cem programming language
- Light light light chapter 23
- Into the light chapter 22
- Chapter 22
- Hardware description language (hdl) can be used as a
- Passive pattern
- Voice rules chart
- Passive voice converter machine
- Active voice passive voice present indefinite
- This in passive voice
- Passive voice vs active voice
- Perbedaan linear programming dan integer programming
- Greedy vs dynamic programming