Play door chime through speaker
This commit is contained in:
parent
2e408e4109
commit
2059073f80
BIN
backdoor.ogg
Normal file
BIN
backdoor.ogg
Normal file
Binary file not shown.
BIN
frontdoor.ogg
Normal file
BIN
frontdoor.ogg
Normal file
Binary file not shown.
29
main.py
Normal file
29
main.py
Normal 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
requirements.txt
Normal file
15
requirements.txt
Normal 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
|
Loading…
Reference in New Issue
Block a user