-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCore.py
More file actions
56 lines (30 loc) · 1.42 KB
/
Core.py
File metadata and controls
56 lines (30 loc) · 1.42 KB
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
53
54
55
import pyttsx3
import speech_recognition as sr
from RecordAudio import *
loopbot = 1
r = sr.Recognizer()
engine = pyttsx3.init() # object creation
print("")
print(" ----------------------------------------------------")
print(" | Welcome to Intelligence AI Version 0.01 By Ariel |")
print(" ----------------------------------------------------")
print("")
#Microphone Check
for index, name in enumerate(sr.Microphone.list_microphone_names()):
print("Audio Device with name \"{1}\" found for `(device_index={0})`".format(index, name))
##Rates
rate = engine.getProperty('rate') # getting details of current speaking rate
engine.setProperty('rate', 130) # setting up new voice rate
#Volume
volume = engine.getProperty('volume') #getting to know current volume level (min=0 and max=1)
engine.setProperty('volume',1.0) # setting up volume level between 0 and 1
#Voice
voices = engine.getProperty('voices') #getting details of current voice
#engine.setProperty('voice', voices[1].id) #changing index, changes voices. o for male
engine.setProperty('voice', voices[0].id) #changing index, changes voices. 1 for female
engine.say("Intelligence AI Version 0.01")
engine.say("For help say, help")
engine.runAndWait()
while loopbot == 1:
voice_data = RecordAudio()
respond(voice_data)