Update app.py
Browse files
app.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
import speech_recognition as sr
|
| 3 |
from pydub import AudioSegment
|
|
|
|
| 4 |
|
| 5 |
def transcribe_audio(audio_file_path, input_language):
|
| 6 |
# Auto-detect format from file extension
|
|
@@ -36,7 +37,8 @@ iface = gr.Interface(
|
|
| 36 |
#gr.Textbox(label="Language code (e.g., en-US, fa-IR)")
|
| 37 |
gr.Dropdown(choices=["fa-IR", "en-US", "ar-SA"], label="Choose right language:")
|
| 38 |
],
|
| 39 |
-
outputs="text",
|
|
|
|
| 40 |
title="Speech-to-Text Service",
|
| 41 |
description="Upload or record audio and get transcription using our STT service."
|
| 42 |
)
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import speech_recognition as sr
|
| 3 |
from pydub import AudioSegment
|
| 4 |
+
import os
|
| 5 |
|
| 6 |
def transcribe_audio(audio_file_path, input_language):
|
| 7 |
# Auto-detect format from file extension
|
|
|
|
| 37 |
#gr.Textbox(label="Language code (e.g., en-US, fa-IR)")
|
| 38 |
gr.Dropdown(choices=["fa-IR", "en-US", "ar-SA"], label="Choose right language:")
|
| 39 |
],
|
| 40 |
+
#outputs="text",
|
| 41 |
+
gr.Textbox(label="Transcription results", lines=10),
|
| 42 |
title="Speech-to-Text Service",
|
| 43 |
description="Upload or record audio and get transcription using our STT service."
|
| 44 |
)
|