Home > How To > Make a personal assitant like jarvis in Python – Make Jarvis using Python code

Make a personal assitant like jarvis in Python – Make Jarvis using Python code

Make Jarvis using Python

Here I am going to share some code in python which uses library function to make Jarvis using Python codes. This will help you learning python.

Make Jarvis using Python

Mark Zuckerberg has developed his own personal assistant that works like Ironman’s Jarvis. He is a big man with so many resources you can also build one useful for you.

Python is a very advance language which is helpful in many task. Well here we can use the TTS libraries, speech recognition and synthesis that will help you to create personal assistant.

I learnt this from a blog post of Gurwinder Gulati who shared the code with Internet. He made a personal assistant for himself. He named it Samwise & explains his code. The code is divided into two parts i.e. Jarvis’s Mouth, Jarvis’s Ears, and Jarvis’s Brain.

Also ReadKnow about the Developer preview of Android O

  1. Mouth: does text-to-speech conversion process.
  2. Ears:  Does speech recognition.
  3. Jarvis’s Brain. : process the speech & do corresponding actions.
Make Jarvis using Python
Make Jarvis using Python

As all the resources are collected now. According to this now you need to assemble the resources & code.

The code for this written here. You can assemble all the code & libraries with some research.

Jarvis code download –  Python  speech recognition offline

import speech_recognition
import pyttsx

speech_engine = pyttsx.init(‘sapi5’) # see http://pyttsx.readthedocs.org/en/latest/engine.html#pyttsx.init
speech_engine.setProperty(‘rate’, 150)

def speak(text):
speech_engine.say(text)
speech_engine.runAndWait()

recognizer = speech_recognition.Recognizer()

def listen():
with speech_recognition.Microphone() as source:
recognizer.adjust_for_ambient_noise(source)
audio = recognizer.listen(source)

try:
return recognizer.recognize_sphinx(audio)
# or: return recognizer.recognize_google(audio)
except speech_recognition.UnknownValueError:
print(“Could not understand audio”)
except speech_recognition.RequestError as e:
print(“Recog Error; {0}”.format(e))

return “”

speak(“Say something!”)
speak(“I heard you say ” + listen())

If you made it & start using the assistant, you can write us in the comment box to let us know. Thank you for the support. Like us on Facebook for more Updates. Thank You.

Leave a Reply

Your email address will not be published. Required fields are marked *