Desktop Assistant Final

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 15

DESKTOP ASSISTANCE BY

PYTHON
Submitted by :
MANDA
GAUREESHWAR (19H51A0111)
MOHAMMED AZMATH (19H51A0112)
AMBEERU ADITHYA (19H51A0102)
B. VENU GOPAL (19H51A0103)
RAYALA SAI KRISHNA (19H51A0119)
Introduction
• A Desktop Assistant is a technology based on Artificial intelligence. The software uses a device’s
microphone to receive voice requests while the voice output takes place at the speaker.But the
most exciting thing happens between these two actions.
• It is a combination of several different technologies: voice recognition, voice analysis and language
processing.
• It is completely developed using one of the most powerful language python.
HOW DOES AN INTELLIGENT DESKTOP ASSISTANT WORK?

• The natural language audio Signal is converted into digital data that can be analyzed by
the software.
• Compared with a database of the software using an innovative algorithm to find a suitable
answer.
• This database is located on distributed servers in cloud networks.For this reason ,it must
have a reliable internet connection.
EXISTING SYSTEM

• SIRI from Apple


• Alexa
• Google Assistant
• Cortana

DRAWBACKS

For using these assistants one should have an account (like Google account for Google
assistant, Miccrosoft account for Cortana) and can use it with internet connection only because
these assistants are going to work with internet connectivity.They are integrated with many
devices like,phones,laptops,and speakers etc.
PROPOSED SYSTEM

Functionalities:
• It can send emails
• It can play music
• It can do wikipedia searches for you
• It can open websities like Google,Youtube,etc.
• It can give weather forecast

Advantages
• SCOUT is different from other traditional voice assistants in terms that it is specific to
desktop and user does not need to make account to do this.
SOFTWARE DESIGN
•.
Data Flow
• It will take input through voice commands related to
task with which is required to be done.

input • It will perform the required task for the user like
opening notepad, searching on browser, sending
mails, playing songs etc
.
perform

• It keeps on asking for the command from user


until the user say "Quit". Once the user say
"Quit", it exits.

Exit
VISUAL STUDIO

Visual Studio is an Integrated Development Environment(IDE) developed by Microsoft to develop


GUI(Graphical User Interface), console, Web applications, web apps, mobile apps, cloud, and web services,
etc. With the help of this IDE, you can create managed code as well as native code. It uses the various
platforms of Microsoft software development software like Windows store, Microsoft Silverlight, and
Windows API, etc. It is not a language-specific IDE as you can use this to write code in C#, C++,
VB(Visual Basic), Python, JavaScript, and many more languages. It provides support for 36 different
programming languages. It is available for Windows as well as for macOS.
PYTHON LIBRARIES

In JARVIS following python libraries were used:


1. pyttsx3: It is a python library which converts text to speech.
2. SpeechRecognition: It is a python module which converts speech to
text.
3.Twilio:It is a Python library which enable us to send text message
4. Datetime: This library provides us the actual date and time.
5. Wikipedia: It is a python module for searching anything on Wikipedia.
6. Smtplib: Simple mail transfer protocol that allows us to send mails and to
route mails between mail servers.
7.WolframAlpha:It is search Engine offers its users numerous special
functions and enable users to perform simple and complex calculations.
8. Pyjokes: It is a python libararies which contains lots of interesting jokes in
it.
9. Webbrowser: It provides interface for displaying web-based documents to
users.
10. os: It represents Operating System related functionality.
11. sys: It allows operating on the interpreter as it provides access to the
variables and functions that usually interact strongly with the interpreter.
FLOW CHART :

A flowchart is a type of diagram that represents a workflow of the project


Steps involved in the project are as follows:
▪ The user clicks the button in the GUI and then gives instruction to the virtual desktop
assistant in the form of voice command.
▪ The voice command is captured by the voice assistant and is converted to a text
format using various modules. ▪ This process is called speech Recognition.
▪ The output i.e., text generated is then used to executed the instruction and get the
work done.
▪ After the task is executed the voice assistant gives an audio file as output, which
explains that the execution is finished
FEATURES :
Voice Assistant offers voice commands, voice searching, and voice-activated device control, letting you
complete a number of tasks after you've said the "OK " or "Hey " wake words. It is designed to give you
conversational interactions. Voice Assistant will:
• Control your devices and your smart home
• Access information from your calendars and other personal information
• Find information online, from restaurant bookings to directions, weather and news
• Control your music
• Play content on your Chromecast or other compatible devices
• Run timers and reminders
• Make appointments and send message
•Open apps on your phone
• Read your notifications to you
• Real-time spoken translations
• Play games
SOURCE CODE :

import speech_recognition as sr # recognise


speech import playsound # to play an audio files
from gtts import gTTS # google text to speech
import random
from time import ctime # get time
details import webbrowser # open
browser import ssl import certifi
import time import os # to remove
created audio files from PIL import
Image import subprocess
importpyautogui #screenshot
import pyttsx3
import bs4 as bs
import urllib.requestimportpyjokes
import numpy as np import
cv2 #tkinter
import tkinter as tk
from tkinter import *
import tkinter.font as
font def start():
Classperson:
name=''def
setName(self, name):
self.name=name
class asis: name
def setName(self, name):
self.name =name r =sr.Recognizer() # initialise
arecogniser # listenforaudio and convert it to text:
def record_audio(ask=""): with sr.Microphone() as source: # microphone as source
if ask: engine_speak(ask)
audio = r.listen(source, 5, 5) # listen for the audio via source print("Done Listening")
voice_data = '' try:
voice_data =r.recognize_google(audio) # convert audio to text except
sr.UnknownValueError: # error:
recognizer does not understand engine_speak('Idid not get that') except
sr.RequestError:
engine_speak('Sorry, the service is down') # error: recognizer is not connected
print(">>", voice_data.lower()) # print what user said return voice_data.lower()
# get string and make a audio file to be played def engine_speak(audio_string):
audio_string = str(audio_string)
tts = gTTS(text=audio_string, lang='en') # text to speech(voice)r r
random.randint(1,20000000)
audio_file = 'audio' + str(r) + '.mp3' tts.save(audio_file) # save
playsound.playsound(audio_file) # play the audio file p
print(asis_obj.name+":",audio_string) # print what app said o
os.remove(audio_file) # remove audio file
def there_exists(terms):
forterminter if term in voice_data:
return True
def engine_speak(text):
text=str(text)engine.say(text)
engine.runAndWait()
def respond(voice_data):
#1:Greeting
if there_exists(['hey','hi','hello','hai']):
greetings = ["hey, how can I help you" +
person_obj.name, "hey, what's up?" + person_obj.name, "I'm listening"
+ person_obj.name, "how can I help you?" + person_obj.name,
"hello"+person_obj.name]greet=greetings[random.randint(0,len(greetin
gs)-1)]
engine_speak(greet)
# 2: Name
if there_exists(["what is your name","what's your name","tell me your
name"]): ifperson_obj.name:engine_speak("whatswithmyname")
else:
engine_speak("I am assistant, My name is Aranya")
# 3:Well Wishing
if there_exists(["how are you","how are you doing"]): engine_speak("I'm very
well, thanks for asking " + person_obj.name)
# 4: Time
if there_exists(["what's the time","tell me the time","what time is it", "time
please","what is the time"]): time=ctime().split("")[3].split(":")[0:2]
if time[0] == "00":
hours='12'
else:
hours = time[0] minutes =time[1]time = hours + " hours and " + minutes +
"minutes"engine_speak(time)
# 5: Search Google
if there_exists(["search for", "search about"]) and 'youtube' not in voice_data:
search_term = voice_data.split("for")[-1]
url = "https://google.com/search?q=" +
search_termwebbrowser.get().open(url)
engine_speak("Here is what I found for" + search_term + "on google") #6
#6Open Whatsapp
if there_exists(["whats app", "open whatsapp","send a
message","openwhatsapp"]):
#search_term = voice_data.split("for")[-1]
url = "https://web.whatsapp.com/" webbrowser.get().open(url)
engine_speak("Opening Whatsapp")
# 6: Search Youtube
if there_exists(["youtube"]):
search_term = voice_data.split("for")[-1] url="https://www.youtube.com/results?
search_query=" + search_termwebbrowser.get().open(url)
engine_speak("Here is what I found for " + search_term + "on youtube")

#7: Get Stock Price


if there_exists(["price of"]):
search_term = voice_data.split("for")[-1]
url = "https://google.com/search?q=" + search_termwebbrowser.get().open(url)
engine_speak("Here is what I found for " + search_term + " on google")
# 8 Search for Music
if there_exists(["play music"]):
search_term= voice_data.split("for")[-1]
url="https://open.spotify.com/search/"+search_termwebbrowser.get().open(url)
engine_speak("You are listening to"+ search_term +"enjoy sir")
#17 Thank You
if there_exists (["thankyou"]):
engine_speak("My pleasure, I’m here to help you")
#18)Exit
if there_exists(["exit", "quit", "goodbye", "bye", "stop", "shut
up"]):engine_speak("going offline")
exit()
CONCLUSIONS :
▪ Through this voice assistant, we have automated various services using a single line command. It eases most of the tasks of
the user like searching the web, retrieving weather forecast details, vocabulary help and medical related queries. We aim to
make this project a complete server assistant and make it smart enough to act as a replacement for a general server
administration.
▪ The future plans include integrating voice assistant with mobile using React Native to provide a synchronised experience
between the two connected devices. Further, in the long run, voice assistant is planned to feature auto deployment
supporting elastic beanstalk, backup files, and all operations which a general Server Administrator does. The functionality
would be seamless enough to replace the Server Administrator with a voice assistant.

You might also like