Python Project : JARVIS (2022) AI Voice Assistant | Jayanta Sarkar | Skillshare

Playback Speed


  • 0.5x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 2x

Python Project : JARVIS (2022) AI Voice Assistant

teacher avatar Jayanta Sarkar

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Lessons in This Class

12 Lessons (1h 7m)
    • 1. Course Introduction

      4:23
    • 2. Create Speak Function For Audio Output

      5:18
    • 3. Create wish me function to welcome the author

      3:58
    • 4. Take the audio input and convert it into a text

      6:23
    • 5. PyAudio module problem solution

      2:47
    • 6. Search Wikipedia using voice command

      5:25
    • 7. Live news update Using Voice Command

      6:09
    • 8. Search result in search engine using voice command

      6:53
    • 9. Open application using voice command

      5:06
    • 10. Play music and search result in YouTube

      6:10
    • 11. Send WhatsApp message using voice command

      5:45
    • 12. Send email using voice command

      8:44
  • --
  • Beginner level
  • Intermediate level
  • Advanced level
  • All levels

Community Generated

The level is determined by a majority opinion of students who have reviewed this class. The teacher's recommendation is shown until at least 5 student responses are collected.

103

Students

--

Projects

About This Class

78a92754.jpg

In this course, you will learn how you can make one Artificial Intelligence Assistant (JARVIS) using Python Programming Language.

In this course you will Teach how you can create a basic Artificial Intelligence VOICE Assistant and add basic features to it like sending emails, playing songs, searching on Google, etc.

It is a Beginner level course and more following courses will be coming up soon.

No specific skills are required, just passion to learn something new.

Give a moment of your thought to the following question.

Features Of Advance AI Assistant 

1. Send Email

2. Google Search

3. Wikipedia Search

4. Open Tabs in Chrome

5. Play Songs

6. News Updates

7. Send What’s App Messages

8. Open Social Media Websites

9. Send Email

10. Youtube Search

And Many More....

Meet Your Teacher

Hello, I'm Jayanta.

After graduating and holding a degree in "information technology," my professional career began, starting web development and graphics design career in 2018, I never stopped learning new programming skills .

I  learn web development and graphic design skills in Arena Animation. But my most of the skills are self-taught skills. As a self-taught developer and graphics designer, I had the chance to work with meaning of local IT companies to build their websites and train their employee on web programming.

See full profile

Class Ratings

Expectations Met?
    Exceeded!
  • 0%
  • Yes
  • 0%
  • Somewhat
  • 0%
  • Not really
  • 0%
Reviews Archive

In October 2018, we updated our review system to improve the way we collect feedback. Below are the reviews written before that update.

Why Join Skillshare?

Take award-winning Skillshare Original Classes

Each class has short lessons, hands-on projects

Your membership supports Skillshare teachers

Learn From Anywhere

Take classes on the go with the Skillshare app. Stream or download to watch on the plane, the subway, or wherever you learn best.

Transcripts

1. Course Introduction: Good evening, Toni. Hello Tony, I am Jarvis. Please tell me how may I help you? Who is Donald Trump? Searching wikipedia? According to Wikipedia, Donald John Trump, born June 14th, 1946, is an American politician, media personality, and businessman who served as the 45th President of the United States from 2017 to 2021. What if we had a diaries as a state like Iron Man? Agree in this tutorial series, we are going to learn how can we create our own journeys AI assistant. Hello, my name is joint or soccer professionally, I'm a web developer and Python programmer. I have been involved with this for about five years. This is going to be a very fun and crazy project using your webcam and nearly you can control everything in your computer. You can open any application. You can search browsers, you can search Wikipedia, you can open YouTube videos. You can think WhatsApp, message, email, getline, news object, and many more. So next ticket, poor. What can we do with that? So let's start with current news updates. Good evening. Told me. Hello Tony, I am Jarvis. Please tell me how may I help you? Today news, news headlines. Indonesian researchers breed good mosquitoes to combat the Anki, the Indian Express. The trial results showed that deploying mosquitoes with Wolbachia reduced dandy cases by as much as 77 percent in hospitalizations by up to 86%. Now, I'm going to open a website using my voice command. Open Google. As you can see, it opened my web browser and redirect to google.com. Similarly, following this method, you can open YouTube also Open YuJa, as you can see, it redirect to youtube.com. You can open any website using your voice command, like Facebook, GitHub, Stack Overflow, etc.. And not only that, we can start particular query in such engine, search browser, what should I search? Donald Trump? As you can see up there, open my browser. It says the query, Donald Trump. So you can search any result from search engine using voice command. And now I'm going to ask my IP address from my gyrus assistant. My IP address. Your IP is 112.79.116.58. Let's open from application using webcam on Open Command Prompt. As you can see it, open windows, common problem. But now we want to open Photoshop using voice commands. Jarvis, please open Photoshop. As you can see, it's open my Photoshop application. And now I want to play music from my music directory using my voice command. Play music. As you can see, is play our music. You can play any particular music. Otherwise, you can use a non-function to play any music from this list. And now I want to pay particular video in YouTube. Play youtube. What should I search in YouTube? Believers songs. As you can see, it's open my browser. And as you can see, is pretty believers on, in YouTube. And now I want to send a WhatsApp message using the voice command. Sending a message. Who do you want to send a message? And then we need to pass them by number. And then I'm going to press in. What do you want to send? Hello two. As you can see, it's sent our message. Not only that, we can think email also, sinned immune. What should I censor? Hello and welcome to my world womb to send the email address, email address her. Now we need to pass the email address. And then I'm going to press Enter. You can see the content. Hello World, welcome to my world. So our services and applicable to say an email, anyone, Hey, this is not the end. I'm going to add more and more advanced feature in this program. Hey, Mrs, quite powerful, isn't it? For this project, we're going to use Python programming language for this project. You don't need any special requirement, just should have knowledge of basic Python syntax. That's enough. This project going to enhance your Python skills if you think it quite beneficial for you, this enrollment schools, pencil watching this video. 2. Create Speak Function For Audio Output : So finally, I am in my Visual Studio Code editor and I already create a Python file, main.py. And at first, I'm going to create speak function which can speak our audio. So I'm going to type Dave, speak inside the parentheses. Our first argument is audio. Then inside this big function. For now, I'm going to type pus. In this function, we are going to provide text as argument. And this function going to convert this text into a audio. But at first, you need to install a module which is by TDS X3. So now I'm going to open my Windows PowerShell. And now I'm going to install bike CD63 module be installed by D. D is X3. And then I'm going to press Enter. As you can see, it's written requirement already satisfied. But you need to complete your download process and then back to the e-reader. Actually, this module is very important for audio feedback. And then we need to import this module in our file. So I'm going to type import by D is X3, and then just follow my steps and create a variable name engine. Engine equal to pi tt is X3 dot init function. And inside the parentheses, I'm going to use our voice module, which is 75. This is the module of Windows operating systems. And we're going to use it for our audio feedback. Basically, our Windows operating system provides two type of voice. Let me show you. So I'm going to create a variable named Voices versus equal to engine dot. Get property inside the parentheses, inside the single quote voices. And if I print the voice variable, print voices, and then execute this code. Here you can see it provide two different voices, missed two different object. And you can choose any of these voice from this two. I'm going to comment out this print statement and let's let the voice. So I'm going to type engine dot set property. Using set property function. We can set any object from our property. Then inside this hit property function in our first parameter, instead the single quote, who need to pass voice. And in our second parameter, we can select the voice, voices inside the square braces. I'm going to select 0 dot ID. So we select our first object from our list. And if you want to see the voice name, you can print device name. Let me show you. Bring inside the parentheses. Voices. Inside the square root is 0 dot ID. If I execute this code. Here you can see our voice name is David. It's a male voice. And if you want to see the second voice name, then you need to pass one hair. And if I execute this code, you can see our second verse name is Zara, is a female voice. It is up to you. What do you want to prove? As you know, Jarvis is our Millay assistant. So I'm going to use 0 here. I'm going to use David voice for Jarvis. No, let's call the Min function. If underscore, underscore name. If underscore underscore name equal to, equal to instead the double-quotes underscore, underscore main function. Then inside the main function, for now, I'm going to type bus. And then I back to these big function. And from ITT a 63, I'm going to use set function. So I'm going to type engine dot c inside the parenthesis audio. And also need to call another function from by dts X3, which is in green dot run into it. So I'm gonna type in gene dot run and wait. And also I'm going to take variable name for our author. So I'm going to type author equal to Tony. And you can use your name for this example. For now, I don't need this print statement, so I'm going to comment out it. And then I jump into the main function. And now I'm going to call our speak function. So I'm going to type speak inside the parentheses. I'm going to use upstream. Then inside the double quotes, I'm going to type, welcome. Then inside the curly braces, I'm going to call our author name comma. I am Jarvis. So this audio function going to speak this text. Welcome author. I'm Jarvis and as you know, our author name is Tony. So it is going to speak. Welcome Tony, I'm Jarvis. So let's execute this code. Welcome Tony, I am Jarvis. So you clearly less than the voice of our Jarvis. So this is it for this tutorial. So in our upcoming tutorial, we are going to create another function which can who is the author according to time. So thanks for watching this video. Stay tuned for the next part of this project. 3. Create wish me function to welcome the author : So welcome back guys. Once again, I'm in my Visual Studio Code eater. In this section, we're going to create a function according to time. Suppose below then 12 hour gyrus going to wish his author, Good morning and time between 12 hour and 18. Our Java's going to wishes author, Good afternoon. And else it going to wishes author, Good evening. So let's create the Wish me function. So I'm going to type def, wish me. Instead the parenthesis. I don't want to pass any argument. And instead the wisdom function for now, I'm going to type pus. Before I create this function, we need to import a module which is dead time. So I'm going to import datetime. We need to use this module because we need to extract current time from our local machine. So I'm back to my wish me function at first. We need to extract our from our local time. So I'm going to create a variable our hour equal to. I want to extract our in our current time. So I'm going to type datetime dot, datetime dot. Now. After NOW function, I want to extract our type hour. This function going to return our as a string format, but we need to convert this hour integer format. So I'm going to use int function and we need to move it inside the parenthesis. And now I'm going to create wished me function condition for these, I'm going to use if condition if our greater than equal to 0 and our less than 12. Then inside the if condition, I'm going to call the speak function, speak. Inside the parentheses. I'm going to use upstream. And as you know, if our time is below than pillar, we need to speak. Good morning. So I'm going to type. Good morning. And then inside the curly braces, our author name, elseif, hour, greater than equal to 12, and our less than, less than 18. Then inside this condition, once again, I'm going to call this peak function speak inside the parenthesis. Upstream. Between 12 to 18 hour will basically speak. Good afternoon. So I'm gonna type. Good afternoon. Then inside the curly braces, author and then else. Inside the else condition, speak upstream. And instead the string. Good evening. Inside the curly braces author. If we call this function in morning time, it going to wish us good morning. And if you call this function up to 12 AM, is going to wish us with good afternoon. And if it grows 18 hour, it going to wish us with good evening and outside the else-if condition, I want to call speak function once again, speed inside the parentheses. I'm going to use a upstream once again. After which mean it going to introduce himself. So I'm going to type hello inside the parentheses. Author name, Hello Tony IM Jarvis. And also it asked for assistant. So I'm going to type please tell me how may I help you? Tell me how may I help you? You. So it successfully create our main function. And now we need to call this main function inside the main function. So I'm going to comment out this big function and I'm going to call which may function. So let's execute the code and see what is the feedback of our AIE. Good morning Tony. Hello Tony, I am Jarvis. Please tell me how may I help you? So as you can listen, it successfully executed or which Min function. So this is it for this tutorial. In our upcoming tutorial, we're going to take user input using take common function. So stay tuned for our next tutorial. 4. Take the audio input and convert it into a text : Welcome back guys. Once again, we are in my Visual Studio Code editor. And this is the most important part of this exercise. Because in this part, we are going to learn how can we take audio input and convert it into a text. So at first I'm going to create a function which is take command, diff, Take Command. And inside the function. For now, I'm going to type bus. But first we need to install the module could take command from the user. Once again, I opened my Windows PowerShell, and I'm going to type B, install speech recognition. And then I press Enter. As you can see, requirement already satisfied, but you need to complete the download process. So let us back to the code editor. Now, first, we need to import this module in our file. Some type, import speech recognition as SR. And now I'm going to create a docstring in this function. And I'm going to take microphone input from the user and written stream. So this function going to take microphone input from the user and it's going to return a string. And then we need to call reorganize a function from this module are equal to SR dot recognizer. This recognizer function helps to take voice input. Then we start dot microphone function as source. Then inside this function, print Listening. And now I'm going to change post threshold value r dot pause threshold. And I'm going to increase the threshold value 1.5. Now the question is, what is pause threshold? If I press Control and click on Post threshold. Here you can see what is post threshold. As you can see, it's mean second stop non-speaking audio before a face is considered complete by default is come with zero-point 86 and its mean after a word, you stop for more than 0.8 again, then it's going to complete the phrase. And if you increase the boss threshold value, then you can wait 15 seconds up to a word. This is a US good job, posts threshold value. And then we need to use listen function or do equal to r dot listen. Then inside the parentheses source, incentive listen function. I pause the audio source and if you click the listen function here, you can see what Listen function can do. If you want to understand it. You can read the whole document. And once again, I'm back to my main.py file. And now I'm going to use try-except condition dry. Inside the try block. At first I'm going to print a statement. Print inside the parentheses, inside the double quotes, I'm going to print recognizing. And then we need to use the engine which can convert the audio into a stream. So I'm going to type query equal to r dot. You can use recognizing, being recognizing Google, recognizing Google Cloud, recognizing IBM recognizes, sneaks. You can use anything you want, but I'm going to use recognised Google. This is the same engine which is used in your Android phone. And recognize Google is very powerful and so accurate. So in this function, first I'm going to pause or do you as a parameter. And then we need to pass language. I'm from India, so I'm going to use e in dash IN means English, India. It's going to convert the audio into a text. And then I'm going to print inside the parentheses, I'm going to use upstream and inside the double quotes, I'm going to type user said user S8. Inside the curly braces. I'm going to pause the query. And then I'm going to type backslash n for new line character. And if I show you the recognise google function, here you can see our recognize google function use sneaks engine. And as I told you earlier, this function also use in our Android mobile. So it's very correct. So we complete our tick common function. If there isn't a problem in our code, then we need to handle the exception. So I'm going to type except exception as e. Inside the exception. I want to print a statement, print inside the parentheses. I'm going to use upstream. Saudi. Our author name is Tony Saudi, Tony comma, Say that again. And also return a string none. It is not a function, just a string none. And outside the exception also I want to return query, written query. Suppose you speak something but it does not recognize. In that case, it going to return sorry Tony, say that again. And also it return none. So let's call the function and check is it properly work on not. So first I'm going to comment out the Whitney function, and then I'm going to call take common function. So let's execute the code and see is it work or not? Hello world. As you can see, it's recognizing. Let's wait some time. As you can see, it's written hello word, user Sayed, Hello world. So as you can see, our tick count function work perfectly. It can listen our voice. It's also can recognizing our voice and convert the voice into a text. So it successfully take voice user input from the user. So in the next part of this project, we are going to integrate Wikipedia and search result from Wikipedia using a voice command. So thanks for watching this video. Stay tuned for our next part of this video. 5. PyAudio module problem solution: Maybe you face this kind of problem when you call tick common function. Attribute error could not find by audio and no module named by audio. And it is through a error in your terminal. And if you try to download this module in Windows PowerShell, pip install by audio. As you can see, it connecting the pie audio file. But you do not complete the download process. If you don't have record, we'll tools in your Python. In that case, you can face this kind of problem. Maybe some files are missing in your computer. So let's see how we can solve this problem. At first, you'll need to open your browser. Then you need to search an official Python binary files. And then you need to open this link. It's redirect to this website. This also R Python modules. But we need to download by order we'll file. So I'm going to type control it, and I'm going to type by audio. This one. And as you can see, someone already been will file for us. And you need to download the executable file according to your Python version. If I open Windows PowerShell and just type Python, and then I press Enter. As you can see, our Python version is 3.18 and also it is 64-bit. So according to this version, will need to download this binary file. So I'm going to click on it as you can see, it, download it. And then you need to open the download folder. And here you can see they will file name Pi audio. So we need to install this file as a Python module. And if you are a Windows user, first, press Shift and then press right-click. Here you can see the option open PowerShell here. Then just you need to type B install. And r module m is by audio. So I'm going to type PY and then I'm going to press Tab. And as you can see, it, auto-complete define limb. And then you need to press Enter, pre-installed this whole file. As you can see by audio, is already installed with the same version as the provided wheel, because I already downloaded this file. But you'll need to complete the download process. And then if I type Python and also I import by audio module. As you can see, there is no error. So following this method, you can install any module now or take common function work properly. So thanks for watching this video. I hope I solve your problem. 6. Search Wikipedia using voice command : Good to see you guys. Once again, I am in Visual Studio Code Editor. In this tutorial, we are getting results from Wikipedia using our voice command. If you want to know about anything, you can see your AI for result, then Java's going to return result from Wikipedia. So let's start the practical. So at first I'm going to comment out the tick common function. And I'm going to call which may function. Then inside the main function, I'm going to use if condition, if one, then inside the heap condition, I wonder run this function for one time. If you want to run this function over and over again, you can use while loop and inside the if condition, I'm going to type quietly equal to pick common function dot lower function. So first, I'm going to convert our user query into a lowercase. And now we need to install Wikipedia module. So I'm going to open my Windows PowerShell, and then I'm going to install Wikipedia module. So I'm going to type B, install Wikipedia. If I press Enter, as you can see, it being requirement already satisfied, I already downloaded this module, but you need to complete the download process. So let's back to the Visual Studio Code editor and type some code inside this if condition, I'm going to create another if condition IV. And in this condition I'm going to assign trigger word for Wikipedia, which is Wikipedia. Wikipedia. And who, who eats another trigger word for Wikipedia in query. Then inside the if condition, at first, I'm going to call this peak function. Speak inside the parentheses. Searching wikipedia. Suppose you want to search result for Donald Trump, then you can see your Jerry's Donald Trump Wikipedia. Otherwise, who is Donald Trump? As you can see, our Wikipedia word and who are these trigger point for Wikipedia result. So it's going to return result from Wikipedia. Then query to query dot replace function, dot, replace function. And I want to replace our Wikipedia keyword with bank, some retype, wiki, PDR, comma. And I want to replace this keyword with bank. And for results, I'm going to create a variable result equal to. And now I'm going to call a function from Wikipedia module, which is somebody. So I'm going to type wikipedia dot summary function inside the parentheses dot summary function. Then inside the parentheses. At fast, I'm going to pass query as the argument. And our second argument, these sentences, It's mean how many sentences we want as a result from Wikipedia. So I'm going to type sentences. Sentences equal to two. For now i 1 two sentences from Wikipedia result, but at first only to import Wikipedia module in our page. So type import Wikipedia. Then I back to the function. And next I'm going to call speak function once again. So I'm gonna type speak. And inside this big function, I'm going to type according to Wikipedia. According to Wikipedia. Using the summary function we can extract result from Wikipedia. And I stored this result in this result variable. And next I'm going to print the result, preen results. So it's going to print the two sentence result from Wikipedia. And they also wanted to speak the result using journeys. So I'm going to call speak function once again, speak inside the parenthesis result. So finally we successfully integrate our Wikipedia module, our diaries project. So if stem to run the code and see is it work properly or not? So let's run the code. Good evening toning. Hello Tony, I am Jarvis. Please tell me how may I help you? Who he is gone ultra. Searching wikipedia. According to Wikipedia, Donald John Trump, born June 14th, 1946, is an American politician, media personality, and businessman who served as the 45th President of the United States from 2017 to 2021. Born and raised in Queens, New York City, trump graduated from the Wharton School at the University of Pennsylvania with a bachelor's degree in 1968. So at first our Jarvis assistant listen our voice, then it recognizing our voice. And then it prints the text. What usaid, as you know, I said, who is Donald Trump? And as you know, who is the trigger EOP Wikipedia search. That's why when I use this word, it going to return results from Wikipedia. And then our assistant print our results in our terminal and also speak our result in our upcoming tutorial. I'm going to integrate live news update in our Jarvis project. So thanks for watching this video. Stay tuned for our next project. Stay tuned for our next tutorial. 7. Live news update Using Voice Command : Hello guys, Good to see you back. This is the most important section of this project. In this part we are going to integrate live news update in our project. So when we are Jarvis for live news update, then it going to speak current news headline with their content. So let's see how its work. So first, I'm going to create a elseif condition, elif news, news inquiry in query. Then inside the heap condition, I'm going to run speak function, speak inside the parentheses. News headline. Then query equal to query dot replace function. And I want to replace new skewer with bank. To get current news updates. We need to use API. For that. I'm going to use this website, news api dot ORG. This website is free for developers. At first, you need to sign up to this account. And I don't want to cover the sign-up process is very easy. If you do not login this website, you can not get the API key. That's why login is very important. Then go to the URL bar and type slash sources. If I press Enter here, you can see all the country least. So you can select your own country for news update. I'm from India, so I'm going to select India. And here you can see this is my API key. And we need this API key for news update. So I'm going to copy the API key. And then I'm going to back to my Visual Studio Code editor. And I'm going to create a variable URL equal to instead the double-quotes. I'm going to paste my API key. We are getting data using API there. So I need to use a module which is request. So I'm going to import requests, module, import request. And then I'm going to create a variable and are very evenly mixed news. Music world too, request dot gate using Get function, we can get result from this request. And instead the get function I'm going to pass you are as parameter. And then I'm going to convert this contained into a text form. It dot text, as you know, most of the time, a PAC in JSON data. And now we need to convert the JSON data into a Python object using JSON dot log function. So news equal to Jason dot-dot-dot function, JSON dot load function. And inside the parentheses news using JSON loads function will convert JSON data into a Python object. But first, we need to import JSON module in our file. So I'm going to import just one module. Now, let's back to the news APA website. Suppose this is our Python object and we have three property in this object, status, put our result and articles. And instead this article object, we have more objects. So at first we need to access the article object, and then we need to run foreign loop to access all the objects inside the article object. So for article object, I'm going to take a variable and our variable name is art. Art equal to news. Inside the square braces are property name articles. And if I show you the news website once again, as you can see inside the article, we have a property name title, and also have a property named description. Title means news headline, description means news contained. So I want to except the news headline with their contained. For these, we need to use blue. Let me show you. So I'm going to use for loop for article in art. Inside the for loop. First I wanted to print article title, so I'm going to use print inside the parentheses article, instead the square recess title. And after print the article title. And I also want to speak the article title. So I'm going to use Speak function for that with article title. Also, I want to listen news description. So I'm going to duplicate this lines. At first. I'm going to print the description. And also I'm going to speak the description, some new copy the description keyword. And I'm going to paste into this position. And also I'm going to run another speak function. Because up to N1 use is going to jump into the, another news. And between two news I wanted to speak moving onto the next news. Otherwise we cannot understand where our news was over. So under pipe, Moving onto the next peels. So finally, we integrate a new API in our Jarvis. So let's run the code and see is it work properly or not? So there's not a good Good evening, Toni. Hello Tony, I am Jarvis. Please tell me how may I help you? Today news. News headlines. Indonesian researchers breed good mosquitoes to combat donkey, the Indian Express. The trial results showed that deploying mosquitoes with Wolbachia reduced dandy cases by as much as 77 percent and hospitalizations by up to 86%. Moving on to the next news, six rules, every person with diabetes needs to follow this festive season in the a.gov. Follow these six rules to gain control over your sugar levels and stay healthy even with a diabetic condition this festive season. Moving on to the next news. So as you can listen and speak all the news one by one. I hope now this section is clear for you how we can use APIs and extract news from this API. So thanks for watching this video. In the next part of this video, we are going to open web browser using ROS command. You can search YouTube, you can search Google, etc. So please state you. 8. Search result in search engine using voice command : Hello guys, Good to see you back. Once again, I am in my Visual Studio Code Editor. In this section, we're going to learn how can we search result from website using our voice command. Suppose I want to open google.com and then I'm going to come and Jarvis open Google. And then it's going to open my browser and redirect to Google.com. So fast, we need to import the module, which is web browser. So I'm going to import this module, import web browser. It is the module from Python. And then I'm going to create another ellip condition. Elseif, open Google inquiry. Then insert the clip condition. I'm going to call web delta dot append function. Web browser dot open. Then inside the parentheses, inside the double quotes, we need to pass the domain name. Where do we want to be direct? So I'm going to pause Google.com. So let's set the file and run this code. Is it work properly or not? So I'm going to hit the Run button. Good evening. Totally. Hello Tony, I am Jarvis. Please tell me how may I help you Open Google? As you can see, it, open my web browser and redirect to google.com. Similarly, following this method, you can open YouTube also. So I'm going to duplicate the slip condition. And in our garden section, I'm going to type LC open YouTube inquiry. Then redirect to youtube.com. If I said this file and run the code one more time. Good evening. Told me. Hello Tony, I am Jarvis. Please tell me how may I help you open YouTube? As you can see, it redirect to youtube.com. You can open any website using your worst command, like Facebook, GitHub, Stack Overflow, etc. But if you want to search any query in your default search engine for these, we need to write some two more extra lines. Let me show you. So once again, I'm duplicate this ellip condition. Now I want to search result from our default search engine. For these, I'm going to type search browser inquiry. Search browser. Then inside the loop condition, I'm going to call speak function. So I'm going to type speak. Then inside the parentheses, our Jarvis arcs to the user, what should use our search. So Java is going to ask for the user what food I search. So I'm going to type what food I search. And then I'm going to take a variable which can take user command. So you m equal to u admin user command. I'm going to call tech common function. Take command dot lower. Using lower function, we can convert the command into a lowercase. And then I'm going to search this user query in our browser. So once again, I'm going to run browser dot open function, web browser dot open and said the parentheses, I'm going to use ifstream. And inside the curly braces, I'm going to pass the user query, which is u m Min user command. So using this condition, first I'm going to come on my Jarvis search browser. Then our program redirect to these elite condition. And then it runs peak function. What should I search? And then it run it, take common function and take voice input from the user. And then you're going to source the query in your browser. So let's run the code and see is it work properly or not? So I'm going to click on this Play button. Good evening. Hello Toni, I am Jarvis. Please tell me how may I help you search browser? What should I search? Donald Trump? As you can see, up to open my browser, it serves the query Donald Trump. So you can search any result from search engine using burst command. And now I want to search my IP address using voice commands. So I'm going to duplicate this ellipse condition. And I'm going to search LC, IP address inequality, IP address in query. Then instead the ellip condition, I'm going to create a variable which is IP, IP equal to request dot gate. Inside the parentheses. I'm going to regress to a website which can be time, which can return my IP address. Http colon slash api dot IP phi dot ORG. And also I'm going to convert my request into a text form it dot txt. We need to pass another slash after HTTP. It going to return my IP address in a text form it. And then I want to print my IP address in my terminal. So I'm going to call print function. Print inside the parentheses, I'm going to use upstream instead the double-quotes, your IPPEs. Your IP is. Instead the double-quotes IP. I'm going to call the IP variable. And also I'm going to duplicate this line and I'm going to call speak function. If I said this file and run my code and run my code. Good evening. Told me. Hello Tony, I am Jarvis. Please tell me how may I help you? My IP address. Your IP is 1 12, 0.79.116.58. So as you can see, we can open websites, we can search IP address, and also we can search query in search engine. So in the next part of this tutorial, we can open different type of application using different voice commands. So thanks for watching this video. Stay tuned for our next tutorial. 9. Open application using voice command : Hello guys, Good to see you back. This is one of the most exciting part of this project. In this section, we are going to learn how can we open different computer application using voice command. So let's create the else-if condition, a leaf. First, I want to open a command prompt using voice command. So inside the single quotes, I'm going to type Open Command Prompt. Open command prompt in quality. Then insert the clip condition to open any application or the file we need to import OS module. So I'm going to import OS module, import OS. And then a back to the slip condition. And I'm going to tie OS dot system inside the parenthesis. Instead they dole goals. I'm going to type Start cmd. As you know, common prompt is our system application. That's why we need to use OS dot system function. Let's execute the code and see is it work properly or not? So I'm going to hit the Run button. Good afternoon. Hello Toni, I am Jarvis. Please tell me how may I help you? Open Command Prompt. As you can see it, open windows, common problem. But now I want to open Photoshop using voice command. For these, I'm going to create another ellipse condition. So I'm going to duplicate this line. And I'm going to type LC, open Photoshop inequality. Then inside the edit condition, I'm going to create a variable which is quote, but could put the coil two inside the double quotes would need to provide the file location. So I'm going to such Photoshop application in my search bar, Photoshop. Then I select the application and I'm going to right-click on this application. Here you can see option Open file location, and I'm going to click on this location. As you can see, it provides the file location. And then once again, I'm going to press right-click on it. And now I'm going to click on properties. Here you can see option Nim target, who need to copy the target file path. So I'm going to press Control C to copy the file, but then back to the Visual Studio Code editor. And I'm going to paste it inside the double quotes. And now I'm going to remove the extra quotation, IEP, open Photoshop in our query. Then our program going to trigger this butt. And it's going to open our Photoshop application, but only to pass multiple backslash between this folder name, something like that. And then I'm going to call Start file function from OS module, OS dot start file. Inside the parenthesis. I'm going to pass this variable could put. So let's execute the code and see is it properly work on not so I'm going to hit the Run button. Good afternoon. Hello, Toni, I am Jarvis. Please tell me how may I help you? Jarvis, please open Photoshop. As you can see, it's opened my Photoshop application. Using this method, we can open any application using our voice command. Following a similar method, I want to open Visual Studio Code editor using voice command. So I'm going to duplicate this line once again. And I'm going to type LC open code inquiry. Then once again, I'm going back to my search bar and I'm going to type Visual Studio Code. And then right-click on it. And as you can see, option Open file location, and then they click on it. Then I select the icon and right-click on it once again. And then I'm mostly properties. Here you can see option target and I'm going to copy the target location. And then a back to my Visual Studio Code eater. And then I'm going to replace the code book location with this file location. And also need to provide multiple backslash between this folder names, something like that. So there's execute the code and try to open a new Visual Studio Code window in my computer. Good afternoon. Told me. Hello Tony, I am Jarvis. Please tell me how may I help you open code? As you can see, opened a new Visual Studio window in my computer. So following this process, you can open any application using your worst command. So in the next part of this video, we are going to learn how can we play music using our voice command. And also we are going to learn how can we search any video from YouTube. So thanks for watching this video. Stay tuned for next part of this tutorial. 10. Play music and search result in YouTube : Good to see you. Bye guys. Once again, I am in my Visual Studio Code Editor. In this tutorial, we are going to play music using our voice command. Not only that, we are also going to play a YouTube video using our voice command. Suppose I want to watch believer song in YouTube. In that case, we need to come onto our Jarvis to play this song. And you're going to open my browser and redirect to youtube.com and play the song. So let's create our first function. So let's create our first condition to play MP3 music. As you can see, my current working directory, there is a folder named music. And instead the music folder, we have total three MP3 song. So I'm going to use the songs for this example. So first, I'm going to create the ellip condition. Elif, play music inquiry in query. Then inside the ellip condition, first we need to create a variable to store file path. So our variable name is music directory. Music underscore DIR equal to inside the single quotes. I'm going to provide the directory. I already copied the file path and I'm going to paste it here. And also need to provide multiple backslash between folder names. And now I'm going to convert all the songs in a Python list. So I'm going to create a variable, songs equal to 0 is dot least DAR. Instead dependencies. In this function, we need to provide the file path as a parameter list music DAR. So I'm going to copy this variable music directory and paste it here. All the items in this directory, these are now Python list items. And now I want to pick the songs in my terminal. So I'm going to use print function, print inside the parentheses song. And now we need to use OS dot dot file function to play the song. So I'm going to type ways dot start file inside the parenthesis, OS dot, dot, dot join. Inside the join function, we need to purchase two parameter, our file path and the leased item, our file path, or even limeys music directory, music DIR, comma. And I want to play our first song from the least. So songs inside the square braces, I'm going to pass 0, is going to play the first song from the least. So let's execute the code and see is it work properly or not? So I'm going to hit the Run button. Good evening. Hello Toni, I am Jarvis. Please tell me how may I help you play music? As you can see, is play our meals. You can play any particular music. Otherwise, you can use an unknown function to play any music from this list. Otherwise, you can access your AI which music you want to play. So in our upcoming video, I'm going to modify this play music condition. And now I want to play a video in YouTube using voice commands. So for that, I'm going to create another ellip condition, elif, play YouTube commanding query. In query. Then inside the loop condition to play you two video, you need to install in module, which is pi. What keeps this module is very easy to operate. So let's open the windows PowerShell and tried to download it. So as you can see, I am in my Windows PowerShell. And now I'm going to install by what Git module be installed by what we eat. And then I'm going to press Enter. As you can see, requirement already satisfied because I already downloaded it, but you need to complete your download process. Then I bet two IVs or stroke or eater. And I'm going to import this module in this file. Import by what gate as heat. Then I backed to the slip condition. And at fast, I'm going to call the speak function. Speak inside the parentheses. I'm going to type, what should I search in YouTube? Summertime, what I search in YouTube, and quotient mark. So when a command they E2, our div is going to ask, what should I search in YouTube? And then our job is going to take voice user input. For these, I'm going to create a variable cm command equal to take common function inside the parenthesis, dot lower. Using dot lower function, we can convert text into a lowercase. Then we need to call a function from Pi what Git module, which is play on YT. So I'm gonna type qi dot play on YT. Instead the parenthesis I want to use ifstream inside the double quotes and inside the curly braces. I'm going to Bus, see him by what good module is pretty powerful and it's pretty advanced also. And now I want to play believer songs in YouTube. So let's execute the code and see is it worked properly or not? Good evening. Hello Toni, I am Jarvis. Please tell me how may I help you play YouTube? What should I search in YouTube? Believer song. As you can see, it's opened my browser. And as you can see, he split the believer songs in YouTube. So step-by-step, we made our Jarvis have very powerful. In our upcoming video, we are going to say, what's the message using GREs. And also we are going to send email using Jarvis. So thanks for watching this video. Stay tuned for the next part of this tutorial. 11. Send WhatsApp message using voice command : Good to see you guys. In this section we are going to say it, What's the message and e-mail using our West command. So without wasting your time, LET started at fast. I'm going to say, what's the message using voice commands. So I'm going to create another edit condition, elif, send message in query. Then inside the ellipse condition, instead the elite condition first I'm going to call speak function. Speak. Inside the parentheses, inside the double quotes. I'm going to type who do you want to send the message? Some type Who message. And then I'm going to take a variable to sit this number. And our variable name is num, num equal to input. Inside the parenthesis, enter number, and then backslash n for new line. Then once again, I'm going to call this peak function, speak inside the parentheses. I'm going to type. Now, Jarvis going to ask to the user, what do you want to say? And so I'm going to type what? 12 sinned. And then again, I'm going to create another variable, message, MSG equal to, I'm going to call the tech come under lower function, take command, dot lower. And then I'm going to call a function from by what good module. And our function name is send what message? So I'm going to type git dot send what message inside the parenthesis as the first parameter, we need to pass, send a number. So I'm going to pass num variable comma as a second parameter will need to pass the message. So I'm going to pass MSG. Total. We need to purchase for parameter, cinder number, message, hour and minute. So after m is a variable, I'm going to call speak function. Once again, speak. Instead the parenthesis I'm going to type. Please enter time, sir. Sir. First, we need to create variable for our. So I'm going to type capital H, capital H equal to int function, int inside the function, I'm going to call input. I don't want this time in a string format. I want this time in a number form it, That's why I use in function. So instead the double-quotes, I'm going to type into our and backslash n for new line. And then I'm going to duplicate this line. And for minute I'm going to take him variable. And I'm going to type Enter minutes. So as the third parameter, I'm going to send our, and as a second parameter, I'm going to say meat, and then I'm going to save this file. But before you run this code, you should have logging in web dot WhatsApp.com. Otherwise, it's not going to work. So let's execute the code and see is it worked properly or not? But before I run this code, lipstick overview of the elif condition, after sin misses worst quality, It's redirect to this ellip condition. Then our job is going to ask, Who do you want to send the message? Then we need to enter this in a number. And then our job is going to ask, what do you want to say and then we need to speak our message. And also it asked for time when you want to send the message. First you need to enter our and then you need to enter minutes. And then it calls in what message from Pi? What good module. And Henry purse for parameter in this module, number message, our admin. And Katie, the LS name of pi. What good module. So let's execute the code. Good evening. Told me. Hello Tony, I am Jarvis. Please tell me how may I help you send a message? Who do you want to send a message? And now we need to tie this into number. First. We need to type country, cool, I'm from India, So I went to pass plus 9 one. And then we need to pass them by number. And then I'm going to press Enter. What do you want to send? Hello Toni. Please enter time, sir. As you can see, our current time is 1855. So I'm going to pass 18 hour, 57 minute after to meet. I'm going to send the message. Now we need to wait for 60 seconds. As you can see in 60-second, web dot, WhatsApp.com will be open after 22nd message will be delivered. So let's wait while. So I'm going to fast-forward eat. As you can see, it's open our browser and redirect wave dot webaim.com. And also you can see it already type our message. Hello tune. Maybe not listen Tony carefully. That's why he typed hello to you. After 22nd is going to send the message. As you can see, it's sent our message, Hello tune. So now it's clear for you how we can send. What's the message using our voice command by the hilltop, by what good module. In the next part of this video, I'm going to send email using our voice command. So thanks for watching this video. Stay tuned for our next video. 12. Send email using voice command : Hello guys, Good to see you back in this tutorial, we are going to learn how can we say an e-mail using voice command. You can send email anyone. So at fast, I'm going to import a module which is SMTP LIB. And hair. I'm going to tie pip install secure, dash SMTP LIB. And then I'm going to press Enter. As you can see, is certainly recommend already satisfied because I already downloaded, but you need to complete your download process. And then I came back to the Visual Studio Code editor. So at fast or need to import this module in this file. Import SMTP LIB. And then I'm going to create the elif condition LC. Send email inquiry. Then inside the ellip condition at fast, I'm going to call this big function, speak inside the parenthesis. I'm going to type our Java is going to ask what food I censor, what sind, wir, sind, sir. And then I'm going to take voice user input from the user. For this, I'm going to create a variable. Our variable name is contained. Content equal to take common function, tick c'mon dot lower. Then once again, I'm going to call this peak function speak inside the parentheses. Instead the double-quotes. Our Java's going to ask him to say in the e-mail. E-mail enter e-mail address, sir. Sir. And then we need to take email address from the user. For these, I'm going to create another variable to two equal to input. Inside the parentheses. I'm going to type in their email address. And backslash n for new line. And then I'm going to call a function. And our function limeys send him ill. And inside this function, I'm going to pass two parameter. Our first parameter is two, and our second parameter is contained. This function going to send our email. But before we need to create this function. But first I want to show you something. We are going to send email using our email address. And you know, Gmail is very secure. You need to make our Gmail less secure. So you need to open your browser, then go to manage your account section. You can see options security, and then you need to turn on this feature. Less secure apps. You need to turn on this feature. Otherwise, it's not going to work. As you can see, I already on my list secure apps option. Similarly, you need to turn on this option. So there's that to the Visual Studio Code editor and create the function. So I'm going to type def and our function name is sendmail. And inside the parentheses, I'm going to Bus 2 parameter two and contained. Then inside this in malfunction. At first only to create a variable name server, server equal to, I'm going to call SMTP. Smtp function. Let me show you dot ASM PP. Then inside the parentheses. In our first parameter, we need to pass the service provided domain, which is smtp dot gmail.com. And next we need to pass the port number, which is 587. And then we need to call EH, hello function, server dot EH, Lu. This functions are already defining SMTP LIB module. And you can see the stapes in documentation of this module. So I don't do anything special. I just follow the US State. I just follow their state. Then we'll call solver dot start TLS function, server dot start DLS function. Next we need to call Solver dot login function, server dot logging. Inside the parentheses. This login function used for authentication and heroin need to pass two parameters. First only to pass our Gmail address, your Gmail address. And second, inside the double quotes, you need to pass your Gmail password, your password. So you need to type your email address here, and you need to type your password here. And next, we need to call the send mail function from SMTP LIV module. So I'm going to type server dot sendmail inside the parenthesis. Here, we need to pass two parameter. In our first parameter, we need to paste our Gmail address. So I'm going to copy this text and paste it here once again. Next. Next we need to pass sender e-mail address. Which we get from the user. So I'm going to pass to hire a next only to pass the email content, which our function get from the user as a parameter. So I'm going to pass content here. And then we need to run close function to close the connection. So I'm going to type Server dark clothes. So at first, you need to establish connection to your Gmail address using this domain. Then you need to pass the poor. This is the default port via Gmail that can use any one. Then you need to call these two functions. These are necessary. And if you want to read this SMTP Mail API documentation, you can. And then you need to login your G-mail account. So at first you need to pass your Gmail address, then you need to pass your password. And next, you need to call the send mail function to send the email. Once again, you need to pass your Gmail address. And then you need to pass these two parameters which you get from the user or PFOS perimeter is two, means sender email. And then our next parameter is contained. Its mean, what I want to say. And then you need to close the connection using dot close function. And now I'm going to fill the space with my XAML and my password. So I put my G-mail and my password in this function. So let's back to the ellip condition. So when we trigger this condition using sendmail command first or jury is going to ask, what should I say, sir? And then we need to speak our e-mail content and our tech count function going to convert this voice into a text. And next hour Java's going to ask whom to send the mail, enter e-mail address, sir. And then we need to take the militaries who we want to sing. And I'm going to set this e-mail address into variable a. Next I'm going to call this in malfunction. And inside this in male function, we need to pass two parameters are first parameter is two, and the second parameter is e-mail content. So let's execute the code and see is it worked properly or not? Good morning. Told me. Hello, Tony, I am Jarvis. Please tell me how may I help you send him ill. What should I censor? Hello, ordered. Welcome to my world. Willing to send the email et or email address her. Now, we need to pass the e-mail address. So I want to pass me another e-mail address. And then I'm going to press Enter. If I show you my inbox, as you can see, there is a new e-mail from my another email address. If I open this e-mail header, you can see the content Hello World, welcome to my world. So our services and up capable to say an email anyone. So I hope that's clear for you. How can we send email using our voice command? So thanks for watching this video. Stay tuned for our next tutorial.