ThatOneCoder commited on
Commit
00c3087
·
verified ·
1 Parent(s): 3b5f1fa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -0
app.py CHANGED
@@ -12,6 +12,13 @@ audio=mic_recorder(
12
  key=None
13
  )
14
 
 
 
 
 
 
 
 
15
  {
16
  "bytes":audio_bytes, # wav audio bytes mono signal, can be processed directly by st.audio
17
  "sample_rate":sample_rate, # depends on your browser's audio configuration
 
12
  key=None
13
  )
14
 
15
+ def callback()
16
+ if st.session_state.my_recorder_output:
17
+ audio_bytes=st.session_state.my_recorder_output['bytes']
18
+ st.audio(audio_bytes)
19
+
20
+ mic_recorder(key='my_recorder', callback=callback)
21
+
22
  {
23
  "bytes":audio_bytes, # wav audio bytes mono signal, can be processed directly by st.audio
24
  "sample_rate":sample_rate, # depends on your browser's audio configuration