kpreid / shinysdr

Software-defined radio receiver application built on GNU Radio with a web-based UI and plugins. In development, usable but incomplete. Compatible with RTL-SDR.
https://shinysdr.switchb.org/
GNU General Public License v3.0
1.07k stars 115 forks source link

Audio toolbox: allow non-default sample rates #153

Open kpreid opened 3 years ago

kpreid commented 3 years ago

audio-spectrum-main.js constructs an AudioContext with the default sample rate, but this may not be the best sample rate available for a given input device. Detect what that sample rate is and re-create the context to suit. This will require consulting MediaStreamTrack.getCapabilities(), and refactoring to allow replacing the AudioContext after startup.