RESOLVED WONTFIX 262759
When recording audio, volume of recording diminishes after several seconds
https://bugs.webkit.org/show_bug.cgi?id=262759
Summary When recording audio, volume of recording diminishes after several seconds
bryce.a.aebi
Reported 2023-10-05 21:32:40 PDT
I am recording audio in Safari from a Macbook pro microphone using the following basic code: const createStream = async () => { // For iOS Safari, reset to play-and-record to allow mic to work if ((isIOS || isSafari) && navigator.audioSession) { navigator.audioSession.type = "play-and-record"; } const stream = await navigator.mediaDevices.getUserMedia({ video: false, audio: true, }); return stream; }; Without fail, the volume of the audio recording starts out at the expected level and then it diminishes in volume (maybe by more than 50%) after about 5 seconds. This happens both when I record and then play back the audio and also when I run an AnalyserNode on the audio in real time and view the audio data live.
Attachments
bryce.a.aebi
Comment 1 2023-10-05 21:51:15 PDT
Another important detail I've realized -- this only appears to happen when humming a fixed pitch. If I speak normally into the microphone, all of the audio is picked up as expected.
Alexey Proskuryakov
Comment 2 2023-10-09 16:55:41 PDT
This sounds like it could be expected effect of noise reduction, does this reproduce with it disabled in macOS GUI?
bryce.a.aebi
Comment 3 2023-10-09 18:57:37 PDT
Yes, it looks like this was an artifact of noise reduction. When I change the code to this the issue is resolved: const stream = await navigator.mediaDevices.getUserMedia({ audio: { autoGainControl: false, echoCancellation: false, noiseSuppression: false, } }); Thanks for taking a look
youenn fablet
Comment 4 2023-10-10 02:05:32 PDT
Marking as WontFix since this is expected behaviour. Please reopen if needed.
Note You need to log in before you can comment on or make changes to this bug.