on1onmangoes commited on
Commit
dcb65b5
1 Parent(s): f02106f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -2
app.py CHANGED
@@ -1,7 +1,7 @@
1
  import streamlit as st
2
  from transformers import pipeline
3
  from pydub import AudioSegment, silence
4
- import speech_recognition as sr
5
 
6
  pipe = pipeline('sentiment-analysis')
7
  text = st.text_area('Enter your notes')
@@ -12,4 +12,12 @@ if text:
12
 
13
  st.markdown("<h1 style = text align:center;'> Group Therapy Notes </h1>",unsafe_allow_html = True)
14
  st.markdown("---",unsafe_allow_html=True)
15
- audio=st.file_uploader("Upload Your Audio File", type=['mp3','wav','m4a'])
 
 
 
 
 
 
 
 
 
1
  import streamlit as st
2
  from transformers import pipeline
3
  from pydub import AudioSegment, silence
4
+ #import speech_recognition as sr
5
 
6
  pipe = pipeline('sentiment-analysis')
7
  text = st.text_area('Enter your notes')
 
12
 
13
  st.markdown("<h1 style = text align:center;'> Group Therapy Notes </h1>",unsafe_allow_html = True)
14
  st.markdown("---",unsafe_allow_html=True)
15
+ audio=st.file_uploader("Upload Your Audio File", type=['mp3','wav','m4a'])
16
+
17
+ If audio:
18
+ audio_segment= AudioSegment.from_file(audio)
19
+ chunks=silence.split_on_silence(audio_segment, min_silence_length=500, silence_thresh= audio_segment.dBFs-20,keep_silence=100)
20
+ for index, chunk in enumerate (chunks):
21
+ chunk.export(str(index)+".wav", format="wav")
22
+ print(chunk)
23
+