Skip to content

Commit

Permalink
Control windows programs with your voice.
Browse files Browse the repository at this point in the history
  • Loading branch information
Shokr committed Nov 21, 2019
1 parent 60ec264 commit a1b8161
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
2 changes: 2 additions & 0 deletions JARVIS/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# JARVIS
Control windows programs with your voice.
52 changes: 52 additions & 0 deletions JARVIS/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
__author__ = 'Mohammed Shokr <[email protected]>'
__version__ = 'v 0.1'

"""
JARVIS:
- Control windows programs with your voice
"""

# import modules
from datetime import datetime # datetime module supplies classes for manipulating dates and times
import subprocess # subprocess module allows you to spawn new processes

import speech_recognition as sr # speech_recognition Library for performing speech recognition with support for Google Speech Recognition, etc..



# obtain audio from the microphone
r = sr.Recognizer()
with sr.Microphone() as source:
print("Say something!")
audio = r.listen(source)

# recognize speech using Google Speech Recognition
Query = r.recognize_google(audio)
print(Query)


# Run Application with Voice Command Function
def get_app(Q):
if Q == "time":
print(datetime.now())
elif Q == "notepad":
subprocess.call(['Notepad.exe'])
elif Q == "calculator":
subprocess.call(['calc.exe'])
elif Q == "stikynot":
subprocess.call(['StikyNot.exe'])
elif Q == "shell":
subprocess.call(['powershell.exe'])
elif Q == "paint":
subprocess.call(['mspaint.exe'])
elif Q == "cmd":
subprocess.call(['cmd.exe'])
elif Q == "browser":
subprocess.call(['C:\Program Files\Internet Explorer\iexplore.exe'])
else:
print("Sorry ! Try Again")
return


# Call get_app(Query) Func.
get_app(Query)

0 comments on commit a1b8161

Please sign in to comment.