update
This commit is contained in:
parent
33dc2333c4
commit
3627baa228
13
test_sound.py
Normal file
13
test_sound.py
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
import subprocess
|
||||||
|
from datetime import datetime, time
|
||||||
|
from utils.sound_utils import play_alarm_sound, SOUNDS
|
||||||
|
now = datetime.now().time()
|
||||||
|
namaz_zohr_time = time(12, 9) < now < time(13, 20)
|
||||||
|
namaz_maghrib_time = time(17, 24) < now < time(18, 45)
|
||||||
|
if not namaz_zohr_time and not namaz_maghrib_time:
|
||||||
|
print("*** PLAYED ALARM SOUND ***")
|
||||||
|
play_alarm_sound(**SOUNDS["notif"])
|
||||||
|
do_alarm_later = False
|
||||||
|
else:
|
||||||
|
print("*** It's namaz time so we'll play alarm sound later")
|
||||||
|
do_alarm_later = True
|
||||||
BIN
utils/assets/error-08-206492.mp3
Normal file
BIN
utils/assets/error-08-206492.mp3
Normal file
Binary file not shown.
@ -22,7 +22,3 @@ def play_alarm_sound(file_path, volume):
|
|||||||
capture_output=True,
|
capture_output=True,
|
||||||
)
|
)
|
||||||
subprocess.run(["paplay", file_path], capture_output=True)
|
subprocess.run(["paplay", file_path], capture_output=True)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
play_alarm_sound(**SOUNDS["alarm"])
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user