Skip to content

Commit 07c34d0

Browse files
Merge pull request #672 from Shokr/master
JARVIS:- New Script to Control windows programs with voice commands.
2 parents 60ec264 + b8752bf commit 07c34d0

File tree

3 files changed

+56
-0
lines changed

3 files changed

+56
-0
lines changed

JARVIS/JARVIS.py

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
__author__ = 'Mohammed Shokr <[email protected]>'
2+
__version__ = 'v 0.1'
3+
4+
"""
5+
JARVIS:
6+
- Control windows programs with your voice
7+
"""
8+
9+
# import modules
10+
from datetime import datetime # datetime module supplies classes for manipulating dates and times
11+
import subprocess # subprocess module allows you to spawn new processes
12+
13+
import speech_recognition as sr # speech_recognition Library for performing speech recognition with support for Google Speech Recognition, etc..
14+
15+
16+
17+
# obtain audio from the microphone
18+
r = sr.Recognizer()
19+
with sr.Microphone() as source:
20+
print("Say something!")
21+
audio = r.listen(source)
22+
23+
# recognize speech using Google Speech Recognition
24+
Query = r.recognize_google(audio)
25+
print(Query)
26+
27+
28+
# Run Application with Voice Command Function
29+
def get_app(Q):
30+
if Q == "time":
31+
print(datetime.now())
32+
elif Q == "notepad":
33+
subprocess.call(['Notepad.exe'])
34+
elif Q == "calculator":
35+
subprocess.call(['calc.exe'])
36+
elif Q == "stikynot":
37+
subprocess.call(['StikyNot.exe'])
38+
elif Q == "shell":
39+
subprocess.call(['powershell.exe'])
40+
elif Q == "paint":
41+
subprocess.call(['mspaint.exe'])
42+
elif Q == "cmd":
43+
subprocess.call(['cmd.exe'])
44+
elif Q == "browser":
45+
subprocess.call(['C:\Program Files\Internet Explorer\iexplore.exe'])
46+
else:
47+
print("Sorry ! Try Again")
48+
return
49+
50+
51+
# Call get_app(Query) Func.
52+
get_app(Query)

JARVIS/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# JARVIS
2+
Control windows programs with your voice.

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,5 @@ Code documentation is aligned correctly when the files are viewed in [Notepad++]
7777

7878
- [whatsapp-chat-analyzer.py](https://github.com/subahanii/whatsapp-Chat-Analyzer) - This is whatsapp group/individual chat analyzer .
7979
This script is able to analyse all activity happened in whatsapp group and visualize all thing through matplotlib library(In Graph form).
80+
81+
- [JARVIS.py](https://git.io/fjH8m) - Control windows programs with your voice.

0 commit comments

Comments
 (0)