Jarvis AI Desktop Voice Assistant Using Python. You can also calculate number by giving voice command.
Now, we will make a wishme() function that will make our J.A.R.V.I.S. wish or greet the user according to the time of computer or pc. To provide current or live time to A.I., we need to import a module called datetime. Import this module
The next most important thing for our A.I. assistant is that it should take command with the help of the microphone of the user's system. So, now we will make a takeCommand() function. With the help of the takeCommand() function, our A.I. assistant will return a string output by taking microphone input from the user.
Before defining the takeCommand() function, we need to install a module called speechRecognition. Install this module by: pip install speechRecognition
After wishme() function there is take command() which take your voice as a input and convert in text as a string.
you have to use Microphone as a input to take command.
After all that now we have to make main method where we describe function which we want to give as a input to work.
In main method firstly we have to give query like open notepad. So, if it is in query then execute below code.
then you have to define path of your notepad.
Same as like this for other function like open youtube or Google .Yes, here important thing is that you need to import webbrowser module.
Then we put 'Calculation' in query. For that we need to import operator module to do such calculation.
After that we define two function
Also import OS module it helps and allow us to find any thing in your desktop like you want to open notepad then it helps to find location of that file.
YOU CAN ALSO ADD AS MUCH AS FUNCTION YOU WANT TO GIVE IT.
Submitted by Diwesh Prashar (prashardiwesh)
Download packets of source code on Coders Packet
Comments