refactor: move transport configuration from frontend to backend

This commit is contained in:
pstruebi
2025-09-19 13:32:52 +02:00
parent cc9a178701
commit 576d669813
+3 -7
View File
@@ -13,11 +13,7 @@ if 'stream_started' not in st.session_state:
# Global: desired packetization time in ms for Opus (should match backend)
PTIME = 40
BACKEND_URL = "http://localhost:5000"
#TRANSPORT1 = "serial:/dev/serial/by-id/usb-ZEPHYR_Zephyr_HCI_UART_sample_B53C372677E14460-if00,115200,rtscts"
#TRANSPORT2 = "serial:/dev/serial/by-id/usb-ZEPHYR_Zephyr_HCI_UART_sample_CC69A2912F84AE5E-if00,115200,rtscts"
TRANSPORT1 = 'serial:/dev/ttyAMA3,1000000,rtscts' # transport for raspberry pi gpio header
TRANSPORT2 = 'serial:/dev/ttyAMA4,1000000,rtscts' # transport for raspberry pi gpio header
QUALITY_MAP = {
"High (48kHz)": {"rate": 48000, "octets": 120},
"Good (32kHz)": {"rate": 32000, "octets": 80},
@@ -122,7 +118,7 @@ if audio_mode == "Demo":
config1 = auracast_config.AuracastConfigGroup(
auracast_sampling_rate_hz=q['rate'],
octets_per_frame=q['octets'],
transport=TRANSPORT1,
transport='', # is set in backend
bigs=bigs1
)
config2 = None
@@ -130,7 +126,7 @@ if audio_mode == "Demo":
config2 = auracast_config.AuracastConfigGroup(
auracast_sampling_rate_hz=q['rate'],
octets_per_frame=q['octets'],
transport=TRANSPORT2,
transport='', # is set in backend
bigs=bigs2
)
# Call /init and /init2
@@ -331,7 +327,7 @@ else:
config = auracast_config.AuracastConfigGroup(
auracast_sampling_rate_hz=q['rate'],
octets_per_frame=q['octets'],
transport=TRANSPORT1, # transport for raspberry pi gpio header
transport='', # is set in backend
bigs = [
auracast_config.AuracastBigConfig(
code=(stream_passwort.strip() or None),