Antoniskaraolis commited on
Commit
8f1209b
·
1 Parent(s): 241a3f3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -6
app.py CHANGED
@@ -1,11 +1,9 @@
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['content']
7
-
8
- with sr.AudioFile(audio_file) as source:
9
  audio_data = recognizer.record(source)
10
  try:
11
  text = recognizer.recognize_google(audio_data)
 
1
  import gradio as gr
2
+ from speech_recognition import Recognizer, AudioFile
3
 
4
+ def transcribe_audio(file):
5
+ recognizer = Recognizer()
6
+ with AudioFile(file) as source:
 
 
7
  audio_data = recognizer.record(source)
8
  try:
9
  text = recognizer.recognize_google(audio_data)