Closed Mifodix closed 2 years ago
I could not reproduce the bug. Can you provide the complete code and your environment information to reproduce the bug? FYI, I tested it with the code below:
import queue
import streamlit as st
from streamlit_webrtc import (
RTCConfiguration,
WebRtcMode,
webrtc_streamer,
)
webrtc_ctx = webrtc_streamer(
key="sendonly-audio",
mode=WebRtcMode.SENDONLY,
audio_receiver_size=256,
rtc_configuration=RTCConfiguration(
{"iceServers": [{"urls": ["stun:stun.l.google.com:19302"]}]}
),
media_stream_constraints={"audio": True},
)
status = st.empty()
while True:
if webrtc_ctx.audio_receiver:
try:
audio_frames = webrtc_ctx.audio_receiver.get_frames(timeout=1)
status.write([audio_frame.to_ndarray() for audio_frame in audio_frames])
except queue.Empty:
status.warning("Queue is empty. Abort.")
break
else:
print("AudioReciver is not set. Abort.")
break
additionally, what does it mean for the browser1 to stop receiving the frames?
Does webrtc_ctx.audio_receiver.get_frames
throw an exception? Does it return None? Is it frozen?
After update to last versions of requirements i can't reproduce bug.
Streamlit-webrtc used as audio recorder: while True: audio_frames = webrtc_ctx.audio_receiver.get_frames(timeout=1)
How to reproduce:
If change some streamlit widget in Browser1, sound recording resume.