├── .gitignore ├── requirements.txt ├── icon.ico ├── Files ├── Hindi_Responses │ ├── bye.mp3 │ ├── ok.mp3 │ ├── firse_bol.mp3 │ ├── geeli_pappi.mp3 │ ├── not_taught.mp3 │ ├── play_among_us.mp3 │ ├── tell_a_joke_1.mp3 │ ├── who_made_you.mp3 │ ├── how_can_I_help_you.mp3 │ ├── sunai_nahi_de_raha.mp3 │ ├── thoda_uche_se_bolo.mp3 │ ├── iska superchat lagega.mp3 │ └── will_I_be_on_stream.mp3 └── song │ └── rider-provider-song.mp3 ├── generate-exe.ps1 ├── README.md └── speech.py /.gitignore: -------------------------------------------------------------------------------- 1 | __pycache__/ 2 | .idea/ 3 | .vscode/ 4 | venv/ 5 | build/ 6 | dist/ 7 | *.spec 8 | *.exe -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | playsound 2 | PyAudio 3 | pyinstaller 4 | pyttsx3 5 | SpeechRecognition 6 | wikipedia -------------------------------------------------------------------------------- /icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaydeepdholakia/Driver-Nishant-Tanwar-Voice-Assistant/HEAD/icon.ico -------------------------------------------------------------------------------- /Files/Hindi_Responses/bye.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaydeepdholakia/Driver-Nishant-Tanwar-Voice-Assistant/HEAD/Files/Hindi_Responses/bye.mp3 -------------------------------------------------------------------------------- /Files/Hindi_Responses/ok.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaydeepdholakia/Driver-Nishant-Tanwar-Voice-Assistant/HEAD/Files/Hindi_Responses/ok.mp3 -------------------------------------------------------------------------------- /Files/song/rider-provider-song.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaydeepdholakia/Driver-Nishant-Tanwar-Voice-Assistant/HEAD/Files/song/rider-provider-song.mp3 -------------------------------------------------------------------------------- /Files/Hindi_Responses/firse_bol.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaydeepdholakia/Driver-Nishant-Tanwar-Voice-Assistant/HEAD/Files/Hindi_Responses/firse_bol.mp3 -------------------------------------------------------------------------------- /Files/Hindi_Responses/geeli_pappi.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaydeepdholakia/Driver-Nishant-Tanwar-Voice-Assistant/HEAD/Files/Hindi_Responses/geeli_pappi.mp3 -------------------------------------------------------------------------------- /Files/Hindi_Responses/not_taught.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaydeepdholakia/Driver-Nishant-Tanwar-Voice-Assistant/HEAD/Files/Hindi_Responses/not_taught.mp3 -------------------------------------------------------------------------------- /Files/Hindi_Responses/play_among_us.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaydeepdholakia/Driver-Nishant-Tanwar-Voice-Assistant/HEAD/Files/Hindi_Responses/play_among_us.mp3 -------------------------------------------------------------------------------- /Files/Hindi_Responses/tell_a_joke_1.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaydeepdholakia/Driver-Nishant-Tanwar-Voice-Assistant/HEAD/Files/Hindi_Responses/tell_a_joke_1.mp3 -------------------------------------------------------------------------------- /Files/Hindi_Responses/who_made_you.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaydeepdholakia/Driver-Nishant-Tanwar-Voice-Assistant/HEAD/Files/Hindi_Responses/who_made_you.mp3 -------------------------------------------------------------------------------- /Files/Hindi_Responses/how_can_I_help_you.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaydeepdholakia/Driver-Nishant-Tanwar-Voice-Assistant/HEAD/Files/Hindi_Responses/how_can_I_help_you.mp3 -------------------------------------------------------------------------------- /Files/Hindi_Responses/sunai_nahi_de_raha.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaydeepdholakia/Driver-Nishant-Tanwar-Voice-Assistant/HEAD/Files/Hindi_Responses/sunai_nahi_de_raha.mp3 -------------------------------------------------------------------------------- /Files/Hindi_Responses/thoda_uche_se_bolo.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaydeepdholakia/Driver-Nishant-Tanwar-Voice-Assistant/HEAD/Files/Hindi_Responses/thoda_uche_se_bolo.mp3 -------------------------------------------------------------------------------- /Files/Hindi_Responses/iska superchat lagega.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaydeepdholakia/Driver-Nishant-Tanwar-Voice-Assistant/HEAD/Files/Hindi_Responses/iska superchat lagega.mp3 -------------------------------------------------------------------------------- /Files/Hindi_Responses/will_I_be_on_stream.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaydeepdholakia/Driver-Nishant-Tanwar-Voice-Assistant/HEAD/Files/Hindi_Responses/will_I_be_on_stream.mp3 -------------------------------------------------------------------------------- /generate-exe.ps1: -------------------------------------------------------------------------------- 1 | Set-Variable -Name "name" -Value "Bot OP" 2 | 3 | pyinstaller -i icon.ico -n $name --hidden-import=pyttsx3.drivers.sapi5 --onefile speech.py 4 | Copy-Item ./dist/$name.exe ./ -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Driver-Nishant-Tanwar-Voice-Assistant 2 | 3 | ## Environment Setup: 4 | - Install Python 3.6 (higher version will not support all functionalities) 5 | - run `python -m venv venv` 6 | - run `.\venv\Scripts\Activate.ps1` 7 | - run `pip install -r requirements.txt` 8 | 9 | To build the project run `generate-exe.ps1` 10 | 11 | ### Once Your PR is accepted. Please do contact at jaydeepdholakiaop@gmail.com to have it added in the Google Drive Folder so other people can use it's EXE file 12 | -------------------------------------------------------------------------------- /speech.py: -------------------------------------------------------------------------------- 1 | import speech_recognition as sr 2 | import pyttsx3 3 | import datetime 4 | import wikipedia 5 | import webbrowser 6 | import time 7 | #import wolframalpha 8 | import json 9 | import requests 10 | import playsound 11 | import random 12 | 13 | print('Hello! I am a Personal Assistant of Rider OP. My name is Driver. Basically I am named after Rider, Driver. I hope you got the joke!') 14 | 15 | engine=pyttsx3.init() 16 | voices=engine.getProperty('voices') 17 | engine.setProperty('voice',voices[1].id) 18 | engine.setProperty('rate', 150) 19 | 20 | 21 | def speak(text): 22 | engine.say(text) 23 | engine.runAndWait() 24 | 25 | def wishMe(): 26 | hour=datetime.datetime.now().hour 27 | if hour>=0 and hour<12: 28 | speak("Good Morning") 29 | print("Good Morning") 30 | elif hour>=12 and hour<18: 31 | speak("Good Afternoon") 32 | print("Good Afternoon") 33 | else: 34 | speak("Good Evening") 35 | print("Good Evening") 36 | 37 | def takeCommand(): 38 | r=sr.Recognizer() 39 | with sr.Microphone() as source: 40 | print("Listening...") 41 | audio=r.listen(source) 42 | 43 | try: 44 | statement=r.recognize_google(audio,language='en-in') 45 | print(f"user said:{statement}\n") 46 | 47 | except Exception as e: 48 | exception_responses = ['thoda_uche_se_bolo.mp3','sunai_nahi_de_raha.mp3','firse_bol.mp3'] 49 | playsound.playsound('Files/Hindi_Responses/'+random.choice(exception_responses), True) 50 | return "None" 51 | return statement 52 | 53 | speak("Hello! I am a Personal Assistant of Rider OP. My name is Driver. Basically I am named after Rider, Driver. I hope you got the joke! Hahahaha") 54 | wishMe() 55 | 56 | 57 | if __name__=='__main__': 58 | 59 | while True: 60 | playsound.playsound('Files/Hindi_Responses/how_can_I_help_you.mp3',True) 61 | statement = takeCommand().lower() 62 | if statement==0: 63 | continue 64 | 65 | if "bye" in statement or "stop" in statement: 66 | print('Do not forget to subscribe Rider OP!') 67 | playsound.playsound('Files/Hindi_Responses/bye.mp3', True) 68 | playsound.playsound('Files/Hindi_Responses/geeli_pappi.mp3', True) 69 | break 70 | 71 | if 'wikipedia' in statement: 72 | speak('Searching Wikipedia...') 73 | statement =statement.replace("wikipedia", "") 74 | results = wikipedia.summary(statement, sentences=3) 75 | speak("According to Wikipedia") 76 | print(results) 77 | speak(results) 78 | 79 | elif 'tell a joke' in statement or 'tell me a joke' in statement: 80 | playsound.playsound('Files/Hindi_Responses/tell_a_joke_1.mp3', True) 81 | webbrowser.open_new_tab("https://www.youtube.com/watch?v=KGb_wv-GIxs&list=PLqYhxkGfBhrX3jj6NkevYBcoD4mF33w6z") 82 | time.sleep(5) 83 | 84 | elif 'rider song' in statement or 'tik tok' in statement: 85 | playsound.playsound('Files/song/rider-provider-song.mp3', True) 86 | 87 | 88 | elif 'will i be on stream' in statement: 89 | playsound.playsound('Files/Hindi_Responses/will_I_be_on_stream.mp3', True) 90 | 91 | elif 'play among us' in statement: 92 | playsound.playsound('Files/Hindi_Responses/play_among_us.mp3', True) 93 | 94 | elif 'open google' in statement: 95 | playsound.playsound('Files/Hindi_Responses/ok.mp3', True) 96 | webbrowser.open_new_tab("https://www.google.com") 97 | speak("Google chrome is open now") 98 | time.sleep(5) 99 | 100 | elif 'open gmail' in statement: 101 | playsound.playsound('Files/Hindi_Responses/ok.mp3', True) 102 | webbrowser.open_new_tab("gmail.com") 103 | speak("Google Mail open now") 104 | time.sleep(5) 105 | 106 | elif "weather" in statement: 107 | playsound.playsound('Files/Hindi_Responses/ok.mp3', True) 108 | api_key="8ef61edcf1c576d65d836254e11ea420" 109 | base_url="https://api.openweathermap.org/data/2.5/weather?" 110 | speak("whats the city name") 111 | city_name=takeCommand() 112 | complete_url=base_url+"appid="+api_key+"&q="+city_name 113 | response = requests.get(complete_url) 114 | x=response.json() 115 | if x["cod"]!="404": 116 | y=x["main"] 117 | current_temperature = y["temp"] 118 | current_humidiy = y["humidity"] 119 | z = x["weather"] 120 | weather_description = z[0]["description"] 121 | speak(" Temperature in kelvin unit is " + 122 | str(current_temperature) + 123 | "\n humidity in percentage is " + 124 | str(current_humidiy) + 125 | "\n description " + 126 | str(weather_description)) 127 | print(" Temperature in kelvin unit = " + 128 | str(current_temperature) + 129 | "\n humidity (in percentage) = " + 130 | str(current_humidiy) + 131 | "\n description = " + 132 | str(weather_description)) 133 | 134 | else: 135 | speak(" City Not Found ") 136 | 137 | elif 'time' in statement: 138 | playsound.playsound('Files/Hindi_Responses/ok.mp3', True) 139 | strTime=datetime.datetime.now().strftime("%H:%M:%S") 140 | speak(f"the time is {strTime}") 141 | 142 | elif 'who are you' in statement or 'what can you do' in statement: 143 | speak('I am Driver! version 1 point O your persoanl assistant. I am programmed to minor tasks like' 144 | 'opening youtube, google chrome, and gmail, tell time,get top headline news from times of india!' 145 | 'I also play Rider OP songs!') 146 | 147 | 148 | elif "who made you" in statement or "who created you" in statement or "who discovered you" in statement: 149 | playsound.playsound('Files/Hindi_Responses/who_made_you.mp3', True) 150 | print("JDOP has made me!") 151 | 152 | elif 'news' in statement: 153 | news = webbrowser.open_new_tab("https://timesofindia.indiatimes.com/home/headlines") 154 | speak('Here are some headlines from the Times of India,Happy reading') 155 | time.sleep(6) 156 | 157 | elif 'search' in statement: 158 | playsound.playsound('Files/Hindi_Responses/ok.mp3', True) 159 | statement = statement.replace("search", "") 160 | webbrowser.open_new_tab(statement) 161 | time.sleep(5) 162 | 163 | else: 164 | #playsound.playsound('Files/Hindi_Responses/not_taught.mp3', True) 165 | playsound.playsound('Files/Hindi_Responses/iska superchat lagega.mp3', True) 166 | 167 | time.sleep(3) --------------------------------------------------------------------------------