SefyanKehail commited on
Commit
55eefe7
·
1 Parent(s): 08c3015

debugging microphone ...

Browse files
Files changed (2) hide show
  1. app.py +6 -4
  2. requirements.txt +1 -1
app.py CHANGED
@@ -82,6 +82,9 @@ def stop_recording_info(audio):
82
  return gr.update(value="### <i style='color:yellow'>Processing audio, please wait ...</i>", visible=True)
83
  return gr.update(value="", visible=False)
84
 
 
 
 
85
  # Gradio interface
86
  def gui():
87
  with gr.Blocks() as interface:
@@ -101,11 +104,10 @@ def gui():
101
 
102
 
103
  # Use audio_input.change to trigger stop_recording_info when audio changes
104
- audio_input.stop_recording(lambda: None).then(stop_recording_info, inputs=audio_input, outputs=info, queue=False).then(
105
- enable_convert_button, inputs=audio_input, outputs=[convert_button, info], queue=False
106
- )
107
 
108
- # audio_input.change(enable_convert_button, inputs=[audio_input], outputs=[convert_button, info])
 
109
 
110
  convert_button.click(convert_speech, inputs=[audio_input], outputs=[converted_audio])
111
 
 
82
  return gr.update(value="### <i style='color:yellow'>Processing audio, please wait ...</i>", visible=True)
83
  return gr.update(value="", visible=False)
84
 
85
+ def stp():
86
+ print("this is working")
87
+
88
  # Gradio interface
89
  def gui():
90
  with gr.Blocks() as interface:
 
104
 
105
 
106
  # Use audio_input.change to trigger stop_recording_info when audio changes
107
+ # audio_input.stop_recording(stop_recording_info, inputs=[audio_input], outputs=[info])
 
 
108
 
109
+ audio_input.stop_recording(stp)
110
+ audio_input.change(enable_convert_button, inputs=[audio_input], outputs=[convert_button, info])
111
 
112
  convert_button.click(convert_speech, inputs=[audio_input], outputs=[converted_audio])
113
 
requirements.txt CHANGED
@@ -3,4 +3,4 @@ torchaudio
3
  requests
4
  IPython
5
  scikit-learn
6
- gradio
 
3
  requests
4
  IPython
5
  scikit-learn
6
+ gradio==3.44.0