Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,14 +1,19 @@
|
|
1 |
import streamlit as st
|
2 |
from streamlit_mic_recorder import mic_recorder,speech_to_text
|
3 |
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
key=
|
14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import streamlit as st
|
2 |
from streamlit_mic_recorder import mic_recorder,speech_to_text
|
3 |
|
4 |
+
state=st.session_state
|
5 |
+
|
6 |
+
if 'text_received' not in state:
|
7 |
+
state.text_received=[]
|
8 |
+
|
9 |
+
c1,c2=st.columns(2)
|
10 |
+
with c1:
|
11 |
+
st.write("Convert speech to text:")
|
12 |
+
with c2:
|
13 |
+
text=speech_to_text(language='en',use_container_width=True,just_once=True,key='STT')
|
14 |
+
|
15 |
+
if text:
|
16 |
+
state.text_received.append(text)
|
17 |
+
|
18 |
+
for text in state.text_received:
|
19 |
+
st.text(text)
|