Commit
·
a0d4c39
1
Parent(s):
b19baf3
Update app.py
Browse files
app.py
CHANGED
@@ -160,23 +160,26 @@ def return_audio_clip(audio_text):
|
|
160 |
filepath = os.path.join("pre_recoreded",post_file_name)
|
161 |
return filepath
|
162 |
|
163 |
-
with gr.Blocks() as demo:
|
164 |
gr.Markdown("Select audio or record audio")
|
165 |
with gr.Row():
|
166 |
with gr.Column():
|
167 |
-
input_audio_text = gr.Dropdown(["Please select any of the following options","Angry", "Happy", "Sad", "Disgust","Fear", "Surprise", "Neutral"],
|
168 |
-
|
169 |
audio_ui=gr.Audio()
|
170 |
input_audio_text.change(return_audio_clip,input_audio_text,audio_ui)
|
171 |
output_text = gr.Textbox(lable="Prdicted emotion")
|
172 |
sub_btn = gr.Button("Submit")
|
173 |
|
174 |
with gr.Column():
|
175 |
-
audio=gr.Audio(source="microphone", type="file"
|
176 |
recorded_text = gr.Textbox(lable="Prdicted emotion")
|
177 |
with gr.Column():
|
178 |
sub_btn2 = gr.Button("Submit")
|
179 |
-
|
|
|
|
|
|
|
180 |
sub_btn.click(selected_audio, inputs=input_audio_text, outputs=output_text)
|
181 |
sub_btn2.click(recorded_audio, inputs=audio, outputs=recorded_text)
|
182 |
|
|
|
160 |
filepath = os.path.join("pre_recoreded",post_file_name)
|
161 |
return filepath
|
162 |
|
163 |
+
with gr.Blocks(css=".gradio-container {background-color: lightgray;}") as demo:
|
164 |
gr.Markdown("Select audio or record audio")
|
165 |
with gr.Row():
|
166 |
with gr.Column():
|
167 |
+
input_audio_text = gr.Dropdown(lable = "Input Audio",["Please select any of the following options","Angry", "Happy", "Sad", "Disgust","Fear", "Surprise", "Neutral"],
|
168 |
+
interactive=True)
|
169 |
audio_ui=gr.Audio()
|
170 |
input_audio_text.change(return_audio_clip,input_audio_text,audio_ui)
|
171 |
output_text = gr.Textbox(lable="Prdicted emotion")
|
172 |
sub_btn = gr.Button("Submit")
|
173 |
|
174 |
with gr.Column():
|
175 |
+
audio=gr.Audio(labele="Recored audio",source="microphone", type="file")
|
176 |
recorded_text = gr.Textbox(lable="Prdicted emotion")
|
177 |
with gr.Column():
|
178 |
sub_btn2 = gr.Button("Submit")
|
179 |
+
gr.Markdown("""Feel free to give us your [feedback](https://www.pragnakalp.com/contact/) and contact us at [[email protected]]("mailto:[email protected]")
|
180 |
+
if you want to have your own Speech emotion detection system. We are just one click away. And don't forget to check out more interesting
|
181 |
+
[NLP services](https://www.pragnakalp.com/services/natural-language-processing-services/) we are offering.<br/>
|
182 |
+
<p style='text-align: center;'>Developed by :[ Pragnakalp Techlabs](https://www.pragnakalp.com)</p>""")
|
183 |
sub_btn.click(selected_audio, inputs=input_audio_text, outputs=output_text)
|
184 |
sub_btn2.click(recorded_audio, inputs=audio, outputs=recorded_text)
|
185 |
|