This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| say "roses are red" | |
| say "violets are blue" | |
| make president "" | |
| if , "Trump" is president ? ; | |
| say "Trump is in charge, what will we do?" ! | |
| else : | |
| say "If Clinton is in charge, wall street is too" ! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Install speech_recognition with pip install speech_recognition | |
| # Install pyaudio with pip install pyaudio | |
| # Make sure you look up full instructions for installing pyaudio | |
| import speech_recognition as sr | |
| recognizer = sr.Recognizer() | |
| mic = sr.Microphone() | |
| with mic as source: |