Spaces:
Sleeping
Sleeping
Antoniskaraolis
commited on
Commit
·
8f1209b
1
Parent(s):
241a3f3
Update app.py
Browse files
app.py
CHANGED
@@ -1,11 +1,9 @@
|
|
1 |
import gradio as gr
|
2 |
-
|
3 |
|
4 |
-
def transcribe_audio(
|
5 |
-
recognizer =
|
6 |
-
|
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)
|