Skip to content

Commit

Permalink
Create AI_Assistant_Male_Voice.py
Browse files Browse the repository at this point in the history
  • Loading branch information
sksalahuddin2828 authored Jun 24, 2023
1 parent cdb04bf commit 1eed759
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions AI_Assistant_Male_Voice.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
"""
Your peripheral nervous system (PNS) is one of two main parts of your body’s nervous system.
Your PNS feeds information into your brain from most of your senses. It carries signals that allow you to move your muscles.
Your PNS also delivers signals that your brain uses to control vital, unconscious processes like your heartbeat and breathing.
"""

import pyttsx3
import webbrowser

# sapi5 is a Peripheral Nervous System (PNS) in Microsoft Windows. It's like a brain
# It works for Peripheral devices like keyboard, mouse, speaker etc etc.
neuron = pyttsx3.init("sapi5")

while True:
# receive a input from user == when user input in this terminal
com = input("Enter your text: ").lower()

# when get a input from user then check this conditions
if "youtube" in com:
neuron.say("opening YouTube")
neuron.runAndWait()
webbrowser.open("https://www.youtube.com/")

if "search" in com:
neuron.say("search for what ")
neuron.runAndWait()
search=input("").lower()
neuron.say(f"OK, I'm searching for {search}")
neuron.runAndWait()
webbrowser.open(f"https://www.google.com/search?q={search}")

#--------------------------------------------------------------------------------------------

import pyttsx3
import webbrowser

search = pyttsx3.init("sapi5")

while True:
user_input = input("Enter your text: ").lower()

if "youtube" in user_input:
search.say("Opening YouTube, just wait a while")
search.runAndWait()
webbrowser.open("https://www.youtube.com/")

if "search" in user_input:
search.say("What do you want to search from Google?")
search.runAndWait()
search_items = input("Give your search keyword: ").lower()
search.say("Opening your search itmes, just wait a while")
search.runAndWait()
webbrowser.open(f"https://www.google.com/search?q={search_items}")

else:
print("Opps! Try again")

0 comments on commit 1eed759

Please sign in to comment.