TroglodyteDerivations commited on
Commit
c78a491
1 Parent(s): 373d7a6

Updated lines 346, 354-365

Browse files
Files changed (1) hide show
  1. app.py +15 -1
app.py CHANGED
@@ -344,11 +344,25 @@ def display_segment(i):
344
  x1 = int(ratio * word.end)
345
  print(f"{word.label} ({word.score:.2f}): {x0 / bundle.sample_rate:.3f} - {x1 / bundle.sample_rate:.3f} sec")
346
  segment = waveform[:, x0:x1]
347
- return IPython.display.Audio(segment.numpy(), rate=bundle.sample_rate)
348
 
349
  # Part O: Audio generation for each segment
350
  st.write('Abby Cadabby Transcript:')
351
  # Display the audio in the Streamlit app
352
  st.audio(SPEECH_FILE, format="audio/wav")
353
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
354
  st.image('Abby_and_Prince.jpg')
 
344
  x1 = int(ratio * word.end)
345
  print(f"{word.label} ({word.score:.2f}): {x0 / bundle.sample_rate:.3f} - {x1 / bundle.sample_rate:.3f} sec")
346
  segment = waveform[:, x0:x1]
347
+ return st.audio(segment.numpy(), rate=bundle.sample_rate)
348
 
349
  # Part O: Audio generation for each segment
350
  st.write('Abby Cadabby Transcript:')
351
  # Display the audio in the Streamlit app
352
  st.audio(SPEECH_FILE, format="audio/wav")
353
 
354
+ st.audio(display_segment(0), format="audio/wav")
355
+ st.audio(display_segment(1), format="audio/wav")
356
+ st.audio(display_segment(2), format="audio/wav")
357
+ st.audio(display_segment(3), format="audio/wav")
358
+ st.audio(display_segment(4), format="audio/wav")
359
+ st.audio(display_segment(5), format="audio/wav")
360
+ st.audio(display_segment(6), format="audio/wav")
361
+ st.audio(display_segment(7), format="audio/wav")
362
+ st.audio(display_segment(8), format="audio/wav")
363
+ st.audio(display_segment(9), format="audio/wav")
364
+ st.audio(display_segment(10), format="audio/wav")
365
+ st.audio(display_segment(11), format="audio/wav")
366
+
367
+
368
  st.image('Abby_and_Prince.jpg')