This repository has been archived on 2025-05-16. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
pi-race-timer/app/utils/countdown.py
2025-04-29 23:36:37 +02:00

17 lines
428 B
Python

import time
import threading
import pygame
def play_sound(path):
pygame.mixer.init()
sound = pygame.mixer.Sound(path)
sound.play()
time.sleep(sound.get_length())
def start():
def countdown_thread():
for i in range(3):
play_sound("app/static/sounds/beep.wav")
time.sleep(1)
play_sound("app/static/sounds/go.wav")
threading.Thread(target=countdown_thread).start()