-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjacob_speech.py
52 lines (40 loc) · 1.27 KB
/
jacob_speech.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import pyttsx3 as p
import pyjokes
import datetime
import time
engine = p.init()
rate = engine.getProperty('rate')
engine.setProperty('rate',150)
def speak(audio):
engine.say(audio)
engine.runAndWait()
def hour():
h = datetime.datetime.now().hour
if h >= 1 and h< 12:
speak("Good Morning Sir !")
elif h >= 12 and h < 18:
speak("Good Afternoon Sir !")
else:
speak("Good evening sir !")
def date():
year = int(datetime.datetime.now().year)
month = int(datetime.datetime.now().month)
date = int(datetime.datetime.now().day)
speak(date)
speak(month)
speak(year)
def wishme():
hour()
speak("Welcome back!")
#speak("Today's date is")
#date()
speak("Jacob at your service. How can I help you sir ?")
def my_skills():
speak("Sir I can play videos on youtube, search the web for you, give you weather reports, tell you jokes, and the list goes on")
speak("My developers are currently working on embedding IOT features in me as well. Hope you enjoy my services")
def bad_words():
speak("Sir Please Don't abuse. I am sorry if I said something wrong ")
def jokes():
speak(pyjokes.get_joke(language='en',category='neutral'))
def thankYou():
speak("It's my pleasure to help you sir!")