From 69eeeca3fc02100bf259d7a9a83fdcae204e5caf Mon Sep 17 00:00:00 2001 From: Extremesecrecy <10959169+extremesecrecy@users.noreply.github.com> Date: Wed, 23 Jul 2025 22:12:38 -0700 Subject: [PATCH] Handle Empty Samplerates MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Prevents crashes when input/output devices report no sample rates by defaulting to the current rate or 48 kHz if needed Provides a fallback option in the UI so the selected rate is visible even when the device list is empty --- vite/src/pipedal/JackServerSettingsDialog.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/vite/src/pipedal/JackServerSettingsDialog.tsx b/vite/src/pipedal/JackServerSettingsDialog.tsx index f2c88f3..0b24df6 100644 --- a/vite/src/pipedal/JackServerSettingsDialog.tsx +++ b/vite/src/pipedal/JackServerSettingsDialog.tsx @@ -334,6 +334,7 @@ const JackServerSettingsDialog = withStyles( if (result.sampleRate === 0) result.sampleRate = 48000; let sampleRates = intersectArrays(inDevice.sampleRates, outDevice.sampleRates); if (sampleRates.length === 0) sampleRates = inDevice.sampleRates; + if (sampleRates.length === 0) sampleRates = [result.sampleRate || 48000]; let bestSr = sampleRates[0]; let bestErr = 1e36; for (let sr of sampleRates) {