Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -41,7 +41,7 @@ def evaluate_pronunciation(word):
|
|
| 41 |
|
| 42 |
def process_all(word, audio_path):
|
| 43 |
recognized_text, similarity = process_audio(word, audio_path)
|
| 44 |
-
return recognized_text, similarity
|
| 45 |
|
| 46 |
with gr.Blocks(css="body {background-color: #FFFAF0; font-family: 'Comic Sans MS', cursive;} .title {font-size: 24px; text-align: center; color: #FF69B4;}") as demo:
|
| 47 |
gr.Markdown("<h1 class='title'>🎤 재미있는 발음 연습 🎶</h1>")
|
|
@@ -49,16 +49,17 @@ with gr.Blocks(css="body {background-color: #FFFAF0; font-family: 'Comic Sans MS
|
|
| 49 |
with gr.Row():
|
| 50 |
word_input = gr.Textbox(label="연습할 단어를 입력하세요! ✏️")
|
| 51 |
tts_button = gr.Button("👂 듣기")
|
| 52 |
-
tts_audio = gr.Audio(label="🔊 원어민 발음", type="filepath")
|
| 53 |
|
| 54 |
with gr.Row():
|
| 55 |
-
mic_input = gr.Audio(label="🎙️ 내 발음 녹음", type="filepath")
|
| 56 |
result_button = gr.Button("📊 평가하기")
|
| 57 |
|
| 58 |
recognized_text = gr.Textbox(label="📖 인식된 단어")
|
| 59 |
similarity_score = gr.Number(label="🎯 정확도 (%)")
|
|
|
|
| 60 |
|
| 61 |
tts_button.click(evaluate_pronunciation, inputs=word_input, outputs=tts_audio)
|
| 62 |
-
result_button.click(process_all, inputs=[word_input, mic_input], outputs=[recognized_text, similarity_score])
|
| 63 |
|
| 64 |
-
demo.launch()
|
|
|
|
| 41 |
|
| 42 |
def process_all(word, audio_path):
|
| 43 |
recognized_text, similarity = process_audio(word, audio_path)
|
| 44 |
+
return recognized_text, similarity, audio_path
|
| 45 |
|
| 46 |
with gr.Blocks(css="body {background-color: #FFFAF0; font-family: 'Comic Sans MS', cursive;} .title {font-size: 24px; text-align: center; color: #FF69B4;}") as demo:
|
| 47 |
gr.Markdown("<h1 class='title'>🎤 재미있는 발음 연습 🎶</h1>")
|
|
|
|
| 49 |
with gr.Row():
|
| 50 |
word_input = gr.Textbox(label="연습할 단어를 입력하세요! ✏️")
|
| 51 |
tts_button = gr.Button("👂 듣기")
|
| 52 |
+
tts_audio = gr.Audio(label="🔊 원어민 발음", type="filepath", interactive=True)
|
| 53 |
|
| 54 |
with gr.Row():
|
| 55 |
+
mic_input = gr.Audio(label="🎙️ 내 발음 녹음", type="filepath", interactive=True)
|
| 56 |
result_button = gr.Button("📊 평가하기")
|
| 57 |
|
| 58 |
recognized_text = gr.Textbox(label="📖 인식된 단어")
|
| 59 |
similarity_score = gr.Number(label="🎯 정확도 (%)")
|
| 60 |
+
mic_audio_playback = gr.Audio(label="🎧 내 발음 다시 듣기", type="filepath", interactive=True)
|
| 61 |
|
| 62 |
tts_button.click(evaluate_pronunciation, inputs=word_input, outputs=tts_audio)
|
| 63 |
+
result_button.click(process_all, inputs=[word_input, mic_input], outputs=[recognized_text, similarity_score, mic_audio_playback])
|
| 64 |
|
| 65 |
+
demo.launch()
|