Play door chime through speaker

This commit is contained in:
2021-10-06 03:04:07 -06:00
parent 2e408e4109
commit 2059073f80
5 changed files with 44 additions and 0 deletions
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
+29
View File
@@ -0,0 +1,29 @@
import time
import secrets
import pygame
CHIME = 'chime.ogg'
FRONTDOOR = 'frontdoor.ogg'
BACKDOOR = 'backdoor.ogg'
def play_sound(filename):
pygame.mixer.music.load(filename)
pygame.mixer.music.play()
while pygame.mixer.music.get_busy():
pygame.time.Clock().tick(10)
def backdoor():
play_sound(CHIME)
play_sound(BACKDOOR)
time.sleep(1)
play_sound(CHIME)
play_sound(BACKDOOR)
pygame.init()
pygame.mixer.init()
backdoor()
+15
View File
@@ -0,0 +1,15 @@
certifi==2021.5.30
charset-normalizer==2.0.6
idna==3.2
numpy==1.21.2
paho-mqtt==1.5.1
pandas==1.3.3
pycryptodome==3.10.4
pyezviz==0.1.9.4
pygame==2.0.1
python-dateutil==2.8.2
pytz==2021.3
requests==2.26.0
six==1.16.0
urllib3==1.26.7
xmltodict==0.12.0