CineAI commited on
Commit
b33a918
1 Parent(s): 080785f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -7
app.py CHANGED
@@ -6,13 +6,13 @@ import numpy as np
6
 
7
  import streamlit as st
8
  from audio2text.a2t import A2T
9
- from audiorecorder import audiorecorder
10
 
11
- audio = audiorecorder("Click to record", "Click to stop recording")
12
 
13
  def main():
14
- if len(audio) > 0:
15
- st.audio(audio.export().read())
16
  if st.button("Get text"):
17
  with st.spinner("Wait for it...."):
18
  a2t = A2T(audio)
@@ -21,11 +21,9 @@ def main():
21
  st.write(text)
22
  st.success("Done")
23
  else:
24
- print("error")
25
 
26
  if __name__ == "__main__":
27
- # Getting % usage of virtual_memory ( 3rd field)
28
  print('RAM memory % used:', psutil.virtual_memory()[2])
29
- # Getting usage of virtual_memory in GB ( 4th field)
30
  print('RAM Used (GB):', psutil.virtual_memory()[3]/1000000000)
31
  main()
 
6
 
7
  import streamlit as st
8
  from audio2text.a2t import A2T
9
+ from st_audiorec import st_audiorec
10
 
11
+ audio = st_audiorec
12
 
13
  def main():
14
+ if audio is not None:
15
+ print(type(audio))
16
  if st.button("Get text"):
17
  with st.spinner("Wait for it...."):
18
  a2t = A2T(audio)
 
21
  st.write(text)
22
  st.success("Done")
23
  else:
24
+ print("error audio is None")
25
 
26
  if __name__ == "__main__":
 
27
  print('RAM memory % used:', psutil.virtual_memory()[2])
 
28
  print('RAM Used (GB):', psutil.virtual_memory()[3]/1000000000)
29
  main()