ThatOneCoder commited on
Commit
8da0fb2
·
verified ·
1 Parent(s): e754acc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -11
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
- text=speech_to_text(
5
- language='en',
6
- start_prompt="Start recording",
7
- stop_prompt="Stop recording",
8
- just_once=False,
9
- use_container_width=False,
10
- callback=None,
11
- args=(),
12
- kwargs={},
13
- key=None
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)