Skip to content

Commit

Permalink
_____
Browse files Browse the repository at this point in the history
  • Loading branch information
N3RDIUM committed Sep 25, 2021
1 parent 20401a6 commit e94990b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
9 changes: 5 additions & 4 deletions __main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,19 +291,20 @@ def callback(recognizer, audio, resp):
except:
return None

def ADJUST_MICROPHONE(rec,recognizer):
def ADJUST_MICROPHONE(rec,recognizer,resp):
while True:
with rec.mic as source:
recognizer.adjust_for_ambient_noise(source,duration=0.05)
#print(recognizer.energy_threshold)
if not resp.wake:
recognizer.adjust_for_ambient_noise(source,duration=0.5)
#print(recognizer.energy_threshold)
if stopped:
break

print("__________")
bg = r.listen_in_background(m,lambda recognizer, audio: callback(recognizer, audio, resp))
print(":initialisation_successful:")

adj_thread = threading.Thread(target=ADJUST_MICROPHONE,args=(rec,rec.recognizer,),daemon=True)
adj_thread = threading.Thread(target=ADJUST_MICROPHONE,args=(rec,rec.recognizer,resp),daemon=True)
adj_thread.start()

if __name__ == "__main__":
Expand Down
Binary file modified __pycache__/conversations.cpython-38.pyc
Binary file not shown.
4 changes: 2 additions & 2 deletions conversations.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
['What are you doing?',
'Nothing, I\'m talking to you.',
'No, I think you are processing.',
'To talk, I obviously have to process.'],
'To talk, I obviously have to process.','Do you make food?','No, but I can process toast.'],
['What is your name?',
'My name is pion.'],
['What are you?',
'I am pion, the smartest AI I know of.',
'Do you know sophia?',
'No, I think she\'s real. I\'m not real!'],
['What is your purpose?', 'I talk to bored people to entertain them, but I sometimes do annoy them!'],
['Nothing.','Oh, Okay.'],
['Nothing.','Oh, Okay.','What\'s the joke?'],
['What is your favorite color?','Blue.']]


Expand Down
Binary file modified db.sqlite3
Binary file not shown.

0 comments on commit e94990b

Please # to comment.