
import time
import Rpi.GPIO as GPIO
from piwho import recognition


def blink(pin):
    GPIO.output(pin,GPIO.HIGH)
    time.sleep(1)
    GPIO.output(pin,GPIO.LOW)
    time.sleep(1)

def authorize():
    recog = recognition.SpeakerRecognizer('./recordings/')
    name = recog.identify_speaker()
    if name == 'ABCD':
        return True
    else:
        return False


if __name__ == "__main__":
    GPIO.setmode(GPIO.BOARD)
    GPIO.setup(11,GPIO.OUT)
    if authorize():
        for i in range(5):
            blink(11)

    GPIO.cleanup()
   

@@ -180,25 +180,24 @@
 1)%0A%0Adef 
-authorize
+identify
 ():%0A    
@@ -259,113 +259,239 @@
     
-name = recog.identify_speaker()%0A    if name == 'ABCD':%0A        return True%0A    else:%0A        return False
+friends = %5B'Abhishek', 'Ankit', 'Abhinav'%5D%0A    name = recog.identify_speaker()%0A    if name%5B0%5D in names:%0A        for i in range(10):%0A            blink(11)%0A    elif name%5B1%5D in friends:%0A        for in range(10):%0A            blink(12) 
 %0A%0A%0Ai
@@ -582,72 +582,17 @@
    i
-f authorize():%0A        for i in range(5):%0A            blink(11)%0A
+dentify()
 %0A   

update all examples