Spaces:
Sleeping
Sleeping
Antoniskaraolis
commited on
Commit
·
428f475
1
Parent(s):
434fda4
Update app.py
Browse files
app.py
CHANGED
@@ -1,9 +1,11 @@
|
|
1 |
import gradio as gr
|
2 |
-
|
3 |
|
4 |
-
def transcribe_audio(
|
5 |
-
recognizer = Recognizer()
|
6 |
-
|
|
|
|
|
7 |
audio_data = recognizer.record(source)
|
8 |
try:
|
9 |
text = recognizer.recognize_google(audio_data)
|
|
|
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)
|
10 |
try:
|
11 |
text = recognizer.recognize_google(audio_data)
|