whitphx HF staff commited on
Commit
4360386
·
1 Parent(s): 12adb28
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -506,8 +506,8 @@ def app_sendonly_video():
506
 
507
  image_place = st.empty()
508
 
509
- if webrtc_ctx.video_receiver:
510
- while True:
511
  try:
512
  video_frame = webrtc_ctx.video_receiver.get_frame(timeout=1)
513
  except queue.Empty:
@@ -516,6 +516,9 @@ def app_sendonly_video():
516
 
517
  img_rgb = video_frame.to_ndarray(format="rgb24")
518
  image_place.image(img_rgb)
 
 
 
519
 
520
 
521
  def app_sendonly_audio():
 
506
 
507
  image_place = st.empty()
508
 
509
+ while True:
510
+ if webrtc_ctx.video_receiver:
511
  try:
512
  video_frame = webrtc_ctx.video_receiver.get_frame(timeout=1)
513
  except queue.Empty:
 
516
 
517
  img_rgb = video_frame.to_ndarray(format="rgb24")
518
  image_place.image(img_rgb)
519
+ else:
520
+ logger.warning("AudioReciver is not set. Abort.")
521
+ break
522
 
523
 
524
  def app_sendonly_audio():