Antoniskaraolis commited on
Commit
e83c83d
·
1 Parent(s): f785382
Files changed (1) hide show
  1. app.py +18 -18
app.py CHANGED
@@ -1,22 +1,22 @@
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)
10
- try:
11
- text = recognizer.recognize_google(audio_data)
12
- return text
13
- except Exception as e:
14
- return f"Error: {str(e)}"
15
 
16
- iface = gr.Interface(
17
- fn=transcribe_audio,
18
- inputs="audio",
19
- outputs="text"
20
- )
21
 
22
- iface.launch(share=True)
 
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)
10
+ # try:
11
+ # text = recognizer.recognize_google(audio_data)
12
+ # return text
13
+ # except Exception as e:
14
+ # return f"Error: {str(e)}"
15
 
16
+ #iface = gr.Interface(
17
+ # fn=transcribe_audio,
18
+ # inputs="audio",
19
+ # outputs="text"
20
+ #)
21
 
22
+ #iface.launch(share=True)