

{"id":108113,"date":"2022-06-01T08:00:29","date_gmt":"2022-06-01T02:30:29","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=108113"},"modified":"2026-06-01T12:59:53","modified_gmt":"2026-06-01T07:29:53","slug":"voice-assistant-project-python","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/voice-assistant-project-python\/","title":{"rendered":"Develop Desktop Voice Assistant using Python"},"content":{"rendered":"<p>Nowadays, with the development of technology, we are preferring to speak rather than type. We all would be using Siri, Google Assistant, Alexa, etc. All these assistants are built using complex algorithms and steady hard work. These not only make our task easy but also save time. It would be wonderful to build a personal voice assistant right? In this article, we will be guiding you to build such a Voice Assistant Project using Python. So, let\u2019s get started.<\/p>\n<h3>What is a Voice Assistant?<\/h3>\n<p>A Voice assistant is a user interface that takes the voice commands from the user and does the corresponding task. The task might be responding to the queries, connecting to the device, and doing the work specified by the user like opening google, etc. Here, we will be mimicking such a system using Python.<\/p>\n<h3>Voice Assistant project in Python<\/h3>\n<p>We will be using multiple Python modules to build this voice assistant for doing different tasks like accessing files from the device, opening a browser, finding time, weather, etc. One of the main modules is the speech_recognition which is the heart of the whole project. Using this, we will be listening to the voice messages, decode them and also give vocal outputs.<\/p>\n<p>Other modules can be used based on the commands we are adding to our assistant. The ones we will be using in this article are:<\/p>\n<p>1.\u00a0 Subprocess: This module can be used to get information from the device to do the tasks like sleep, shutdown, etc.<\/p>\n<p>2. Wolframalpha: This module helps us in answering some questions with the help of Wolfram\u2019s algorithms, knowledgebase and AI technology.<\/p>\n<p>3. Pyttsx3: Using this module helps in converting the text to speech form.<\/p>\n<p>4. Datetime: This module is used to get the current time<\/p>\n<p>5. Wikipedia: This module helps in opening wikipedia and searching for what the user asks.<\/p>\n<p>6. Webbrowser: This module also helps in opening the browser and performing search.<\/p>\n<p>7. Winshell and Os: This module helps in accessing the files and folders in the device<\/p>\n<p>8. Pyjokes: Pyjokes module contains different jokes which can be made listened to by the user.<\/p>\n<p>9. Requests: This helps in accessing the websites using url.<\/p>\n<p>10. Shutil: This allows us to modify and operate on the files in the device.<\/p>\n<p>11. Smtplib: This module helps in sending emails.<\/p>\n<p>12. Bs4: This module helps in extracting information from the request made to the website.<\/p>\n<p>13. <span style=\"font-weight: 400\">Tkinter: We use this module to build the GUI<\/span><\/p>\n<h3>Download Python Voice Assistant Project<\/h3>\n<p>Please download the source code for the voice assistant in Python using the link: <a href=\"https:\/\/drive.google.com\/file\/d\/1V7aF_mZxJc723VbmCHPD4T0Y9uDSewL-\/view?usp=drive_link\"><strong>Python Voice Assistant Project<\/strong><\/a><\/p>\n<h3>Prerequisites<\/h3>\n<p>It is advised that the user has prior knowledge of python and some command on basic Python modules. Some of the module we use are standard ones, while the ones that we have to import are as follows:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">pip install wolframalpha\r\npip install pyttsx3\r\npip install wikipedia\r\npip install winshell\r\npip install pyjokes\r\npip install smtplib\r\npip install twilio\r\npip install beautifulsoup4\r\npip install tk<\/pre>\n<h3>Steps to build the Voice Assistant Project using Python<\/h3>\n<p>We will be following the below steps to build the voice assistant:<\/p>\n<p>1. First, we import the modules.<\/p>\n<p>2. Followed by this, we will be building the voice assistant and create function to speak using the voice engine<\/p>\n<p>3. Then we create the function to wish, get the name of the user and command<\/p>\n<p>4. Next, we will be writing functions to do various tasks like getting a weather report, sending mail, etc.<\/p>\n<p>5. Finally, we write the while loop to run the assistant continuously. In which we take the command and check the command to do the respective task using if else statements.<\/p>\n<p>6. Note that all the tasks we include are our choice. Depending on your comfort, you can add required commands and remove the ones that you don\u2019t need. And make the voice assistant based on your suitability.<\/p>\n<h3>1. Import the modules<\/h3>\n<p>The first step is to import all the required modules. We are importing the ones that we discussed above.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">import subprocess\r\nimport wolframalpha\r\nimport pyttsx3\r\nimport random\r\nimport speech_recognition as sr\r\nimport wikipedia\r\nimport webbrowser\r\nimport os\r\nimport winshell\r\nimport pyjokes\r\nimport json\r\nimport feedparser\r\nimport smtplib\r\nimport datetime \r\nimport requests\r\nfrom twilio.rest import Client\r\nfrom bs4 import BeautifulSoup\r\nimport win32com.client as wincl\r\nfrom urllib.request import urlopen<\/pre>\n<h3>2. Building the Voice Assistant and write function to speak<\/h3>\n<p>Next, we will be getting the voice assistant using the module pyttsx3. We set the appropriate properties to the engine and write a function to speak the text sent as input.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">voiceEngine = pyttsx3.init('sapi5')\r\nvoices = voiceEngine.getProperty('voices')\r\nvoiceEngine.setProperty('voice', voices[1].id)\r\n\r\ndef speak(text):\r\n    voiceEngine.say(text)\r\n    voiceEngine.runAndWait()<\/pre>\n<h3>3. Writing functions to wish, get username, and get command<\/h3>\n<p>In this step, we will be creating the required function, the ones that we use to wish initially, get the name and take command after every completion of a task.<\/p>\n<p>1. In the wish() function, we are calculating time and then based on that we are doing the appropriate greeting. Followed by, we are introducing the assistant.<\/p>\n<p>2. In the getName() function, we are getting the name of the user as a command and then storing it in the global variable named \u2018uname\u2019.<\/p>\n<p>3. And in the function getCommand(), we will be recognizing the microphone, listen to the user\u2019s voice, and format it to a text form.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">def wish():\r\n    print(\"Wishing.\")\r\n    time = int(datetime.datetime.now().hour)\r\n    global uname,asname\r\n    if time&gt;= 0 and time&lt;12:\r\n        speak(\"Good Morning sir or madam!\")\r\n\r\n    elif time&lt;18:\r\n        speak(\"Good Afternoon sir or madam!\")\r\n\r\n    else:\r\n        speak(\"Good Evening sir or madam!\")\r\n\r\n    asname =\"Jasper 1 point o\"\r\n    speak(\"I am your Voice Assistant from DataFlair,\")\r\n    speak(asname)\r\n    print(\"I am your Voice Assistant,\",asname)\r\ndef getName():\r\n    global uname\r\n    speak(\"Can I please know your name?\")\r\n    uname = takeCommand()\r\n    print(\"Name:\",uname)\r\n    speak(\"I am glad to know you!\")\r\n    columns = shutil.get_terminal_size().columns\r\n    speak(\"How can i Help you, \")\r\n    speak(uname)\r\n\r\ndef takeCommand():\r\n    recog = sr.Recognizer()\r\n    \r\n    with sr.Microphone() as source:\r\n        print(\"Listening to the user\")\r\n        recog.pause_threshold = 1\r\n        userInput = recog.listen(source)\r\n\r\n    try:\r\n        print(\"Recognizing the command\")\r\n        command = recog.recognize_google(userInput, language ='en-in')\r\n        print(f\"Command is: {command}\\n\")\r\n\r\n    except Exception as e:\r\n        print(e)\r\n        print(\"Unable to Recognize the voice.\")\r\n        return \"None\"\r\n\r\n    return command<\/pre>\n<h3>4. Creating functions for some of the tasks<\/h3>\n<p>Here we will be creating functions to send mail, get the weather report, and get news.<\/p>\n<p>1. In the sendEmail() function, we are connecting to the mail server, logging in using appropriate credentials, and sending the mail to the required receiver.<\/p>\n<p>2. In the function getWeather(), we are getting the url for the required city. Then getting the request, converting it to json form and getting required details by indexing.<\/p>\n<p>3. In the getNews() function, we are getting the request of the new website, then scraping the information using the bs4 module. Then, getting the main headlines.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">def sendEmail(to, content):\r\n    print(\"Sending mail to \", to)\r\n    server = smtplib.SMTP('smtp.gmail.com', 587)\r\n    server.ehlo()\r\n    server.starttls()\r\n    #paste your email id and password in the respective places\r\n    server.login('your email id', 'password') \r\n    server.sendmail('your email id', to, content)\r\n    server.close()\r\n\r\ndef getWeather(city_name):\r\n    cityName=place.get() #getting input of name of the place from user\r\n    baseUrl = \"http:\/\/api.openweathermap.org\/data\/2.5\/weather?\" #base url from where we extract weather report\r\n    url = baseUrl + \"appid=\" + 'd850f7f52bf19300a9eb4b0aa6b80f0d' + \"&amp;q=\" + cityName  \r\n    response = requests.get(url)\r\n    x = response.json()\r\n\r\n    #If there is no error, getting all the weather conditions\r\n    if x[\"cod\"] != \"404\":\r\n        y = x[\"main\"]\r\n        temp = y[\"temp\"]\r\n        temp-=273 \r\n        pressure = y[\"pressure\"]\r\n        humidity = y[\"humidity\"]\r\n        desc = x[\"weather\"]\r\n        description = z[0][\"description\"]\r\n        info=(\" Temperature= \" +str(temp)+\"\u00b0C\"+\"\\n atmospheric pressure (hPa) =\"+str(pressure) +\"\\n humidity = \" +str(humidity)+\"%\" +\"\\n description = \" +str(description))\r\n        print(info)\r\n        speak(\"Here is the weather report at\")\r\n        speak(city_name)\r\n        speak(info)\r\n    else:\r\n        speak(\" City Not Found \")\r\n\r\ndef getNews():\r\n    try:\r\n        response = requests.get('https:\/\/www.bbc.com\/news')\r\n  \r\n        b4soup = BeautifulSoup(response.text, 'html.parser')\r\n        headLines = b4soup.find('body').find_all('h3')\r\n        unwantedLines = ['BBC World News TV', 'BBC World Service Radio',\r\n                    'News daily newsletter', 'Mobile app', 'Get in touch']\r\n\r\n        for x in list(dict.fromkeys(headLines)):\r\n            if x.text.strip() not in unwantedLines:\r\n                print(x.text.strip())\r\n    except Exception as e:\r\n        print(str(e))<\/pre>\n<h3>5. The main code to run the assistant<\/h3>\n<p>Finally, we are creating the code to run the voice assistant. First, we are creating the global names, wishing and getting the username. Next, in a while loop we continuously get the command, check the command using the if-else ladder and do corresponding operation.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">if __name__ == '__main__':\r\n\r\n    uname=''\r\n    asname=''\r\n    os.system('cls')\r\n    wish()\r\n    getName()\r\n    print(uname)\r\n\r\n    while True:\r\n\r\n        command = takeCommand().lower()\r\n        print(command)\r\n\r\n        if \"jarvis\" in command:\r\n            wish()\r\n            \r\n        elif 'how are you' in command:\r\n            speak(\"I am fine, Thank you\")\r\n            speak(\"How are you, \")\r\n            speak(uname)\r\n\r\n        elif \"good morning\" in command or \"good afternoon\" in command or \"good evening\" in command:\r\n            speak(\"A very\" +command)\r\n            speak(\"Thank you for wishing me! Hope you are doing well!\")\r\n\r\n        elif 'fine' in command or \"good\" in command:\r\n            speak(\"It's good to know that your fine\")\r\n       \r\n        elif \"who are you\" in command:\r\n            speak(\"I am your virtual assistant.\")\r\n\r\n        elif \"change my name to\" in command:\r\n            speak(\"What would you like me to call you, Sir or Madam \")\r\n            uname = takeCommand()\r\n            speak('Hello again,')\r\n            speak(uname)\r\n        \r\n        elif \"change name\" in command:\r\n            speak(\"What would you like to call me, Sir or Madam \")\r\n            assname = takeCommand()\r\n            speak(\"Thank you for naming me!\")\r\n\r\n        elif \"what's your name\" in command:\r\n            speak(\"People call me\")\r\n            speak(assname)\r\n        \r\n        elif 'time' in command:\r\n            strTime = datetime.datetime.now()\r\n            curTime=str(strTime.hour)+\"hours\"+str(strTime.minute)+\"minutes\"+str(strTime.second)+\"seconds\"\r\n            speak(uname)\r\n            speak(f\" the time is {curTime}\")\r\n            print(curTime)\r\n\r\n        elif 'wikipedia' in command:\r\n            speak('Searching Wikipedia')\r\n            command = command.replace(\"wikipedia\", \"\")\r\n            results = wikipedia.summary(command, sentences = 3)\r\n            speak(\"These are the results from Wikipedia\")\r\n            print(results)\r\n            speak(results)\r\n\r\n        elif 'open youtube' in command:\r\n            speak(\"Here you go, the Youtube is opening\\n\")\r\n            webbrowser.open(\"youtube.com\")\r\n\r\n        elif 'open google' in command:\r\n            speak(\"Opening Google\\n\")\r\n            webbrowser.open(\"google.com\")\r\n\r\n        elif 'play music' in command or \"play song\" in command:\r\n            speak(\"Enjoy the music!\")\r\n            music_dir = \"C:\\\\Users\\\\Gayathri\\\\Music\"\r\n            songs = os.listdir(music_dir)\r\n            print(songs)\r\n            random = os.startfile(os.path.join(music_dir, songs[1]))\r\n\r\n        elif 'joke' in command:\r\n            speak(pyjokes.get_joke())\r\n            \r\n        elif 'mail' in command:\r\n            try:\r\n                speak(\"Whom should I send the mail\")\r\n                to = input()\r\n                speak(\"What is the body?\")\r\n                content = takeCommand()\r\n                sendEmail(to, content)\r\n                speak(\"Email has been sent successfully !\")\r\n            except Exception as e:\r\n                print(e)\r\n                speak(\"I am sorry, not able to send this email\")\r\n\r\n        elif 'exit' in command:\r\n            speak(\"Thanks for giving me your time\")\r\n            exit()\r\n\r\n        elif \"will you be my gf\" in command or \"will you be my bf\" in command:\r\n            speak(\"I'm not sure about that, may be you should give me some time\")\r\n\r\n        elif \"i love you\" in command:\r\n            speak(\"Thank you! But, It's a pleasure to hear it from you.\")\r\n\r\n        elif \"weather\" in command:\r\n            speak(\" Please tell your city name \")\r\n            print(\"City name : \")\r\n            cityName = takeCommand()\r\n            getWeather(cityName)\r\n\r\n        elif \"what is\" in command or \"who is\" in command:\r\n            \r\n            client = wolframalpha.Client(\"API_ID\")\r\n            res = client.query(command)\r\n\r\n            try:\r\n                print (next(res.results).text)\r\n                speak (next(res.results).text)\r\n            except StopIteration:\r\n                print (\"No results\")\r\n\r\n        elif 'search' in command:\r\n            command = command.replace(\"search\", \"\")\r\n            webbrowser.open(command)\r\n\r\n        elif 'news' in command:\r\n            getNews()\r\n        \r\n        elif \"don't listen\" in command or \"stop listening\" in command:\r\n            speak(\"for how much time you want to stop me from listening commands\")\r\n            a = int(takeCommand())\r\n            time.sleep(a)\r\n            print(a)\r\n\r\n        elif \"camera\" in command or \"take a photo\" in command:\r\n            ec.capture(0, \"Jarvis Camera \", \"img.jpg\")\r\n        \r\n        elif 'shutdown system' in command:\r\n                speak(\"Hold On a Sec ! Your system is on its way to shut down\")\r\n                subprocess.call('shutdown \/ p \/f')\r\n\r\n        elif \"restart\" in command:\r\n            subprocess.call([\"shutdown\", \"\/r\"])\r\n\r\n        elif \"sleep\" in command:\r\n            speak(\"Setting in sleep mode\")\r\n            subprocess.call(\"shutdown \/ h\")\r\n\r\n        elif \"write a note\" in command:\r\n            speak(\"What should i write, sir\")\r\n            note = takeCommand()\r\n            file = open('jarvis.txt', 'w')\r\n            speak(\"Sir, Should i include date and time\")\r\n            snfm = takeCommand()\r\n            if 'yes' in snfm or 'sure' in snfm:\r\n                strTime = datetime.datetime.now().strftime(\"% H:% M:% S\")\r\n                file.write(strTime)\r\n                file.write(\" :- \")\r\n                file.write(note)\r\n            else:\r\n                file.write(note)\r\n        else:\r\n            speak(\"Sorry, I am not able to understand you\")<\/pre>\n<h3><span style=\"font-weight: 400\">6. Code to create the GUI<\/span><\/h3>\n<p><span style=\"font-weight: 400\">In this code, we create a GUI with a button that starts the voice assistant by calling the function callVoiceAssistant(). And also shows the message of listening while the assistant is trying to get a command from the user.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#Creating the main window \r\nwn = tkinter.Tk() \r\nwn.title(\"DataFlair Voice Assistant\")\r\nwn.geometry('700x300')\r\nwn.config(bg='LightBlue1')\r\n  \r\nLabel(wn, text='Welcome to meet the Voice Assistant by DataFlair', bg='LightBlue1',\r\n      fg='black', font=('Courier', 15)).place(x=50, y=10)\r\n\r\n#Button to convert PDF to Audio form\r\nButton(wn, text=\"Start\", bg='gray',font=('Courier', 15),\r\n       command=callVoiceAssistant).place(x=290, y=100)\r\n\r\nshowCommand=StringVar()\r\ncmdLabel=Label(wn, textvariable=showCommand, bg='LightBlue1',\r\n      fg='black', font=('Courier', 15))\r\ncmdLabel.place(x=250, y=150)\r\n\r\n#Runs the window till it is closed\r\nwn.mainloop()\r\n<\/pre>\n<h3>Output of Python Voice Assistant project<\/h3>\n<p>Here is the output on the console of the voice assistant.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">Wishing.\r\nI am your Voice Assistant from DataFlair, Jasper 1 point o\r\nListening to the user\r\nRecognizing the command\r\nCommand is: Bob\r\n\r\nName: Bob\r\nBob\r\nListening to the user\r\nRecognizing the command\r\nCommand is: how are you\r\n\r\nhow are you\r\nListening to the user\r\nRecognizing the command\r\nCommand is: fine\r\n\r\nfine\r\nListening to the user\r\nRecognizing the command\r\nCommand is: can I know time\r\n\r\ncan i know time\r\n22hours31minutes57seconds\r\nListening to the user\r\nRecognizing the command\r\n\r\nUnable to Recognize the voice.\r\nnone\r\nListening to the user\r\nRecognizing the command\r\nCommand is: open Google\r\n\r\nopen google\r\nListening to the user\r\nRecognizing the command\r\n\r\nUnable to Recognize the voice.\r\nnone\r\nListening to the user\r\nRecognizing the command\r\nCommand is: exit\r\n\r\nexit<\/pre>\n<p>Output of Python Voice Assistant GUI<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/03\/python-voice-assistant-output.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-110363\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/03\/python-voice-assistant-output.webp\" alt=\"python voice assistant output\" width=\"874\" height=\"427\" \/><\/a><\/p>\n<h3>Summary<\/h3>\n<p>Hurray! You have successfully built your personal voice assistant. Feel free to add more commands based on your requirement. And get ready to be a bit lazy with the command!<span hidden class=\"__iawmlf-post-loop-links\" data-iawmlf-links=\"[{&quot;id&quot;:2573,&quot;href&quot;:&quot;https:\\\/\\\/drive.google.com\\\/file\\\/d\\\/1V7aF_mZxJc723VbmCHPD4T0Y9uDSewL-\\\/view?usp=drive_link&quot;,&quot;archived_href&quot;:&quot;http:\\\/\\\/web-wp.archive.org\\\/web\\\/20260601073022\\\/https:\\\/\\\/drive.google.com\\\/file\\\/d\\\/1V7aF_mZxJc723VbmCHPD4T0Y9uDSewL-\\\/view?usp=drive_link&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2026-06-02 07:11:01&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-06-05 09:00:02&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-06-08 22:41:40&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-06-14 14:04:04&quot;,&quot;http_code&quot;:200}],&quot;broken&quot;:false,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-06-14 14:04:04&quot;,&quot;http_code&quot;:200},&quot;process&quot;:&quot;done&quot;}]\"><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Nowadays, with the development of technology, we are preferring to speak rather than type. We all would be using Siri, Google Assistant, Alexa, etc. All these assistants are built using complex algorithms and steady&#46;&#46;&#46;<\/p>\n","protected":false},"author":5,"featured_media":110364,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[46],"tags":[21063,21082,22734,21099,27047,26669,27048,26668],"class_list":["post-108113","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python","tag-beginner-python-project","tag-python-project","tag-python-project-for-beginners","tag-python-project-with-source-code","tag-python-voice-assistant","tag-python-voice-assistant-project-source-code","tag-voice-assistant","tag-voice-assistant-project-using-python"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Develop Desktop Voice Assistant using Python - DataFlair<\/title>\n<meta name=\"description\" content=\"Create Voice Assistant Project using Python. It is a user interface that takes the voice commands from the user &amp; does the corresponding task.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/data-flair.training\/blogs\/voice-assistant-project-python\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Develop Desktop Voice Assistant using Python - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Create Voice Assistant Project using Python. It is a user interface that takes the voice commands from the user &amp; does the corresponding task.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/voice-assistant-project-python\/\" \/>\n<meta property=\"og:site_name\" content=\"DataFlair\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DataFlairWS\/\" \/>\n<meta property=\"article:published_time\" content=\"2022-06-01T02:30:29+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-06-01T07:29:53+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/03\/voice-assistant-python-project.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"DataFlair Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:site\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DataFlair Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Develop Desktop Voice Assistant using Python - DataFlair","description":"Create Voice Assistant Project using Python. It is a user interface that takes the voice commands from the user & does the corresponding task.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/data-flair.training\/blogs\/voice-assistant-project-python\/","og_locale":"en_US","og_type":"article","og_title":"Develop Desktop Voice Assistant using Python - DataFlair","og_description":"Create Voice Assistant Project using Python. It is a user interface that takes the voice commands from the user & does the corresponding task.","og_url":"https:\/\/data-flair.training\/blogs\/voice-assistant-project-python\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2022-06-01T02:30:29+00:00","article_modified_time":"2026-06-01T07:29:53+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/03\/voice-assistant-python-project.webp","type":"image\/webp"}],"author":"DataFlair Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"DataFlair Team","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/voice-assistant-project-python\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/voice-assistant-project-python\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/7f83c342f5d1632d6f7b4b0b0f447823"},"headline":"Develop Desktop Voice Assistant using Python","datePublished":"2022-06-01T02:30:29+00:00","dateModified":"2026-06-01T07:29:53+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/voice-assistant-project-python\/"},"wordCount":1042,"commentCount":3,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/voice-assistant-project-python\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/03\/voice-assistant-python-project.webp","keywords":["Beginner Python Project","Python project","python project for beginners","python project with source code","Python Voice Assistant","Python Voice Assistant Project source code","Voice Assistant","Voice Assistant Project using Python"],"articleSection":["Python Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/voice-assistant-project-python\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/voice-assistant-project-python\/","url":"https:\/\/data-flair.training\/blogs\/voice-assistant-project-python\/","name":"Develop Desktop Voice Assistant using Python - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/voice-assistant-project-python\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/voice-assistant-project-python\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/03\/voice-assistant-python-project.webp","datePublished":"2022-06-01T02:30:29+00:00","dateModified":"2026-06-01T07:29:53+00:00","description":"Create Voice Assistant Project using Python. It is a user interface that takes the voice commands from the user & does the corresponding task.","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/voice-assistant-project-python\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/voice-assistant-project-python\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/voice-assistant-project-python\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/03\/voice-assistant-python-project.webp","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/03\/voice-assistant-python-project.webp","width":1200,"height":628},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/voice-assistant-project-python\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"Python Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/python\/"},{"@type":"ListItem","position":3,"name":"Develop Desktop Voice Assistant using Python"}]},{"@type":"WebSite","@id":"https:\/\/data-flair.training\/blogs\/#website","url":"https:\/\/data-flair.training\/blogs\/","name":"DataFlair","description":"Learn Today. Lead Tomorrow.","publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/data-flair.training\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/data-flair.training\/blogs\/#organization","name":"DataFlair","url":"https:\/\/data-flair.training\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","width":106,"height":48,"caption":"DataFlair"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataFlairWS\/","https:\/\/x.com\/DataFlairWS","https:\/\/www.linkedin.com\/company\/dataflair-web-services-pvt-ltd\/","https:\/\/www.youtube.com\/user\/DataFlairWS"]},{"@type":"Person","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/7f83c342f5d1632d6f7b4b0b0f447823","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/4cf3a74600d131330b8c481d519afd1574093ed89f6d3396a95393ad223eb7cd?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/4cf3a74600d131330b8c481d519afd1574093ed89f6d3396a95393ad223eb7cd?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4cf3a74600d131330b8c481d519afd1574093ed89f6d3396a95393ad223eb7cd?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"DataFlair Team creates expert-level guides on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. Our goal is to empower learners with easy-to-understand content. Explore our resources for career growth and practical learning.","url":"https:\/\/data-flair.training\/blogs\/author\/dfteam1\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/108113","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=108113"}],"version-history":[{"count":8,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/108113\/revisions"}],"predecessor-version":[{"id":148654,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/108113\/revisions\/148654"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/110364"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=108113"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=108113"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=108113"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}