@@ -0,0 +1,622 @@
+from time import sleep%0Aimport os%0Aimport signal%0Aimport subprocess%0Aimport CHIP_IO.GPIO as GPIO%0Aimport datetime%0Afrom time import sleep%0A%0AGPIO.setup(%22XIO-P0%22, GPIO.IN)%0AGPIO.add_event_detect(%22XIO-P0%22, GPIO.RISING)%0Aif GPIO.event_detected(%22XIO-P0%22):%0A    print %22Rising edge detected ===========%22%0A    if not is_playing:%0A        fname = datetime.datetime.now().strftime(%22%25Y-%25m-%25d %25H:%25M:%25S%22)%0A        musicprocess = subprocess.Popen(%5B'arecord', '-f', 'cd', '-D', 'hw:0,0', fname%5D, stdout=PIPE, stderr=PIPE)%0A        is_playing = True%0A    else:%0A        os.killpg(os.getpdig(musicprocess.pid), signal.SIGTERM)%0A        is_playing = False%0A%0A

add jingyi detecting back in