An AI assistant like the one in marvel's iron man movies
- Python modules :
- webbrowser
$ sudo pip3 install webbrowser
- wikipedia
$ sudo pip3 install wikipedia
- playsound
$ sudo pip3 install playsound
- speech_recognition
$ sudo pip3 install SpeechRecognition
- webbrowser
- Linux tools :
- espeak
$ sudo apt-get install espeak
- flite
$ sudo apt-get install flite
- espeak
In the Text_To_Speech.py
file, the flite
command is being executed in the Linux shell using the subprocess
python module .
flite
command takes as option -voice
to choose the voice, in our case it is 'rms. To see all available voices in
flite, execute the following line in the Linux shell
flite -lv`.
The JARVIS object takes a command from the user using google speech recognizer and executes what it was told and talks to the user using the flite
command .
- At startup, no command is taken the JARVIS module plays the
JARVIS.mp3
file which is taken from the iron man marvel movie clip . "hello"
or"hi"
so that JARVIS could greet the user based on what time it is, morning, noon or evening ."open site example.com"
so that JARVIS will openexample.com
in the user's browser ."search wikipedia for example"
so that JARVIS would search for results and tell the user a summary of what it found (if exists) ."goodbye"
, "bye", "turn off"
,"shut down"
or"system off"
so that JARVIS would stop the program from running .- If JARVIS was given a command not listed in his dataset, it respond with
"Sorry, I can't do that"
.
These commands are being handled by a function in the JARVIS class called decision
.