Antoniskaraolis commited on
Commit
32b3d3b
·
1 Parent(s): c287037

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -1,9 +1,9 @@
1
  import gradio as gr
2
- import speech_recognition as sr # Importing the speech_recognition module
3
 
4
  def transcribe_audio(file_info):
5
  recognizer = sr.Recognizer()
6
- audio_file = file_info['content']
7
 
8
  with sr.AudioFile(audio_file) as source:
9
  audio_data = recognizer.record(source)
@@ -15,7 +15,7 @@ def transcribe_audio(file_info):
15
 
16
  iface = gr.Interface(
17
  fn=transcribe_audio,
18
- inputs=gr.Audio(source="microphone", type="file"),
19
  outputs="text"
20
  )
21
 
 
1
  import gradio as gr
2
+ import speech_recognition as sr
3
 
4
  def transcribe_audio(file_info):
5
  recognizer = sr.Recognizer()
6
+ audio_file = file_info
7
 
8
  with sr.AudioFile(audio_file) as source:
9
  audio_data = recognizer.record(source)
 
15
 
16
  iface = gr.Interface(
17
  fn=transcribe_audio,
18
+ inputs="audio",
19
  outputs="text"
20
  )
21