Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pyaudio,os
- import speech_recognition as sr
- r = sr.Recognizer()
- with sr.Microphone() as source:
- audio = r.listen(source)
- def excel():
- os.system("start excel.exe")
- def internet():
- os.system("start chrome.exe")
- def media():
- os.system("start wmplayer.exe")
- def mainfunction():
- user = r.recognize(audio)
- print(user)
- if user == "Excel":
- excel()
- elif user == "Internet":
- internet()
- elif user == "music":
- media()
- while 1:
- mainfunction()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement