reder refresh button even if no mic was present

This commit is contained in:
2025-06-19 14:27:58 +02:00
parent 123c28794d
commit 7348b09c2f

View File

@@ -69,24 +69,29 @@ if audio_mode in ["Webapp", "USB"]:
input_options = []
if not input_options:
st.error("No hardware audio input devices found.")
st.stop()
if default_input not in input_options:
default_input = input_options[0]
col1, col2 = st.columns([3, 1], vertical_alignment="bottom")
with col1:
selected_option = st.selectbox("Input Device", input_options, index=input_options.index(default_input))
with col2:
st.warning("No hardware audio input devices found. Plug in a USB input device and click Refresh.")
if st.button("Refresh"):
try:
requests.post(f"{BACKEND_URL}/refresh_audio_inputs", timeout=3)
except Exception as e:
st.error(f"Failed to refresh devices: {e}")
st.rerun()
# We send only the numeric/card identifier (before :) or 'default'
input_device = selected_option.split(":", 1)[0] if ":" in selected_option else selected_option
input_device = None
else:
if default_input not in input_options:
default_input = input_options[0]
col1, col2 = st.columns([3, 1], vertical_alignment="bottom")
with col1:
selected_option = st.selectbox("Input Device", input_options, index=input_options.index(default_input))
with col2:
if st.button("Refresh"):
try:
requests.post(f"{BACKEND_URL}/refresh_audio_inputs", timeout=3)
except Exception as e:
st.error(f"Failed to refresh devices: {e}")
st.rerun()
# We send only the numeric/card identifier (before :) or 'default'
input_device = selected_option.split(":", 1)[0] if ":" in selected_option else selected_option
else:
input_device = None
start_stream = st.button("Start Auracast")