init
This commit is contained in:
commit
ce1095bb24
27 changed files with 621 additions and 0 deletions
17
app/utils/countdown.py
Normal file
17
app/utils/countdown.py
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
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()
|
||||
Reference in a new issue