Open
Description
There is no way to get the microphone sample rate for web browsers currently.
It might be nice to add parameters to the AudioContext constructor, as in JavaScript, to pass sampleRate and other options:
audioContext = new AudioContext({ sampleRate: 16000, latencyHint: "interactive" });
https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/AudioContext
dart:web_audio provides only empty constructor currently:
https://api.dart.dev/stable/3.1.5/dart-web_audio/AudioContext-class.html
dart:web_audio provides speakers sampleRate, and microphone sampleRate upscaled usually:
final sampleRate = audioContext.sampleRate;
processor.onAudioProcess.listen((event) => event.inputBuffer.sampleRate
in the same time media settings provides non-actual sampleRate for microphone:
final mediaSettings = _mediaStream.getAudioTracks().first.getSettings();
final numberOfChannels = mediaSettings['channelCount'] as int;
final sampleRate = mediaSettings['sampleRate'] as int;