anhnv125 commited on
Commit
16e5af6
·
1 Parent(s): 125b455

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -88,9 +88,9 @@ target = target[:packet_size * (len(target) // packet_size)]
88
  st.subheader('Original audio')
89
  st.audio(uploaded_file)
90
 
91
- st.subheader('Choose loss packet percentage')
92
- loss_percent = st.radio('Loss percentage', ['10%', '20%', '30%', '40%'])
93
- loss_percent = float(loss_percent[:-1])/100
94
  mask_gen = MaskGenerator(is_train=False, probs=[(1 - loss_percent, loss_percent)])
95
  lossy_input = target.copy().reshape(-1, packet_size)
96
  mask = mask_gen.gen_mask(len(lossy_input), seed=0)[:, np.newaxis]
 
88
  st.subheader('Original audio')
89
  st.audio(uploaded_file)
90
 
91
+ st.subheader('Choose expected packet loss rate')
92
+ slider = [st.slider("Expected loss rate for Markov Chain loss generator", 0, 100, step=1)]
93
+ loss_percent = float(slider[0])/100
94
  mask_gen = MaskGenerator(is_train=False, probs=[(1 - loss_percent, loss_percent)])
95
  lossy_input = target.copy().reshape(-1, packet_size)
96
  mask = mask_gen.gen_mask(len(lossy_input), seed=0)[:, np.newaxis]