Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Aug 21, 2024
1 parent 0472bfd commit 3454488
Showing 1 changed file with 14 additions and 17 deletions.
31 changes: 14 additions & 17 deletions mypy/voice assistance
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def sptext():
except sr.UnknownValueError:
print(" Not Understand ")


def speechtx(x):
engine = pyttsx3.init()
voices = engine.getProperty('voices')
Expand All @@ -30,52 +30,49 @@ def speechtx(x):
engine.setProperty('rate',150)
engine.say(x)
engine.runAndWait()


if __name__ == '__main__':

#if sptext().lower() == "Hey Peter":
data1=sptext().lower()
if "your name" in data1:
name = "my name is Harry"
speechtx(name)

elif "old are you" in data1:
age = "i am one year old"
speechtx(age)

elif 'time' in data1:
time = datetime.datetime.now().strftime("%I%M%p")
speechtx(time)

elif 'youtube' in data1:
webbrowser.open("https://www.youtube.com/")

elif 'song' in data1:
webbrowser.open("https://www.youtube.com/watch?v=nFgsBxw-zWQ")

elif "who is your father" in data1:
father = "my father name is ajinesh, he is a great programmer"
speechtx(father)

elif "joke" in data1:
joke_1 = pyjokes.get_joke(language="en",category="neutral")
speechtx(joke_1)

elif 'chatgpt' in data1:
webbrowser.open("https://chatgpt.com/")

elif "quote" in data1:
quote = quote.get_quote()
speechtx(quote)






else:
print("thanks")




else:
print("thanks")

0 comments on commit 3454488

Please sign in to comment.