forked from geekcomputers/Python
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Control windows programs with your voice.
- Loading branch information
Showing
2 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# JARVIS | ||
Control windows programs with your voice. |
This file contains 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
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) |