Update app.py
Browse files
app.py
CHANGED
@@ -61,10 +61,18 @@ def select_and_speak(state):
|
|
61 |
# engine.say(selected_name)
|
62 |
# engine.runAndWait()
|
63 |
play_sound()
|
64 |
-
return
|
65 |
|
66 |
def play_sound():
|
67 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
|
69 |
|
70 |
def reset_names(names):
|
|
|
61 |
# engine.say(selected_name)
|
62 |
# engine.runAndWait()
|
63 |
play_sound()
|
64 |
+
return names_list, selected_name
|
65 |
|
66 |
def play_sound():
|
67 |
+
pygame.mixer.init()
|
68 |
+
pygame.mixer.music.load("output.mp3")
|
69 |
+
pygame.mixer.music.play()
|
70 |
+
while pygame.mixer.music.get_busy() == True:
|
71 |
+
continue
|
72 |
+
|
73 |
+
# Remove the temporary audio file
|
74 |
+
os.remove("output.mp3")
|
75 |
+
# return "<audio autoplay><source src='output.mp3' type='audio/mp3'></audio>"
|
76 |
|
77 |
|
78 |
def reset_names(names):
|