Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,11 +1,15 @@
|
|
|
|
1 |
import speech_recognition as sr
|
2 |
import difflib
|
3 |
import gradio as gr
|
4 |
from gtts import gTTS
|
5 |
import io
|
6 |
-
import os
|
7 |
from pydub import AudioSegment
|
8 |
|
|
|
|
|
|
|
|
|
9 |
# Step 1: Transcribe the audio file
|
10 |
def transcribe_audio(audio):
|
11 |
if audio is None:
|
|
|
1 |
+
import os
|
2 |
import speech_recognition as sr
|
3 |
import difflib
|
4 |
import gradio as gr
|
5 |
from gtts import gTTS
|
6 |
import io
|
|
|
7 |
from pydub import AudioSegment
|
8 |
|
9 |
+
# Create audio directory if it doesn't exist
|
10 |
+
if not os.path.exists('audio'):
|
11 |
+
os.makedirs('audio')
|
12 |
+
|
13 |
# Step 1: Transcribe the audio file
|
14 |
def transcribe_audio(audio):
|
15 |
if audio is None:
|