thak123 commited on
Commit
651a9a0
·
verified ·
1 Parent(s): 5059be4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -2
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 '\n'.join(names_list), selected_name, names_list
65
 
66
  def play_sound():
67
- return "<audio autoplay><source src='output.mp3' type='audio/mp3'></audio>"
 
 
 
 
 
 
 
 
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):