Imarticuslearning commited on
Commit
4a9194f
·
verified ·
1 Parent(s): 8b07eda

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -856,11 +856,13 @@ if st.session_state["generated_questions"]:
856
  if webrtc_ctx.state.playing:
857
  if st.button("⏹️ Stop Recording"):
858
  wav_path = f"response_{idx}.wav"
 
859
  try:
860
  frames = webrtc_ctx.audio_receiver.get_frames(timeout=1)
861
  except Exception as e:
862
  st.error(f"⚠️ Audio capture error: {e}")
863
  frames = []
 
864
  if frames:
865
  try:
866
  pcm = np.concatenate([f.to_ndarray() for f in frames], axis=0)
 
856
  if webrtc_ctx.state.playing:
857
  if st.button("⏹️ Stop Recording"):
858
  wav_path = f"response_{idx}.wav"
859
+
860
  try:
861
  frames = webrtc_ctx.audio_receiver.get_frames(timeout=1)
862
  except Exception as e:
863
  st.error(f"⚠️ Audio capture error: {e}")
864
  frames = []
865
+
866
  if frames:
867
  try:
868
  pcm = np.concatenate([f.to_ndarray() for f in frames], axis=0)