Update drowsiness_detection.py
Browse files- drowsiness_detection.py +5 -5
drowsiness_detection.py
CHANGED
|
@@ -45,14 +45,14 @@ head_down_alert = False
|
|
| 45 |
|
| 46 |
# --- AUDIO SETUP (using Pygame) ---
|
| 47 |
# pygame.mixer.init()
|
| 48 |
-
drowsiness_sound = pygame.mixer.Sound("drowsiness-detected.mp3")
|
| 49 |
-
yawn_sound = pygame.mixer.Sound("yawning-detected.mp3")
|
| 50 |
# head_down_sound = pygame.mixer.Sound("dependencies/audio/head-down-detected.mp3")
|
| 51 |
|
| 52 |
# --- CORE FUNCTIONS ---
|
| 53 |
-
def play_alarm(sound_to_play):
|
| 54 |
-
|
| 55 |
-
|
| 56 |
|
| 57 |
def generate_alert(final_eye_ratio, final_mouth_ratio):
|
| 58 |
global EYE_THRESH_COUNTER, YAWN_THRESH_COUNTER
|
|
|
|
| 45 |
|
| 46 |
# --- AUDIO SETUP (using Pygame) ---
|
| 47 |
# pygame.mixer.init()
|
| 48 |
+
# drowsiness_sound = pygame.mixer.Sound("drowsiness-detected.mp3")
|
| 49 |
+
# yawn_sound = pygame.mixer.Sound("yawning-detected.mp3")
|
| 50 |
# head_down_sound = pygame.mixer.Sound("dependencies/audio/head-down-detected.mp3")
|
| 51 |
|
| 52 |
# --- CORE FUNCTIONS ---
|
| 53 |
+
# def play_alarm(sound_to_play):
|
| 54 |
+
# if not pygame.mixer.get_busy():
|
| 55 |
+
# sound_to_play.play()
|
| 56 |
|
| 57 |
def generate_alert(final_eye_ratio, final_mouth_ratio):
|
| 58 |
global EYE_THRESH_COUNTER, YAWN_THRESH_COUNTER
|