[Webkit-unassigned] [Bug 282939] getUserMedia({audio: true}) does not return system selected device

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Nov 11 13:54:40 PST 2024


https://bugs.webkit.org/show_bug.cgi?id=282939

--- Comment #2 from mattieruth at gmail.com ---
I am attaching three basic html pages the use getUserMedia() to grab audio and demonstrate the issue.

The first simply performs the `getAudio()` I had in my original comment on a 5 second loop, reports what device was used and then discards the tracks and stream. In general, I find that it mostly returns the 'iPhone Microphone', but can occasionally get it to temporarily pick up my Air Pods if I switch between tabs. Subsequent getUserMedia() calls typically end up back on the iPhone Mic, though, so it's short-lived.

The second snippet steps through playing an audio file before calling `getUserMedia({audio: true})`, demonstrating how the audio will initially play from the headphones, but will switch to the iPhone speakers once `getUserMedia()` is called. It has some other toggles for testing like manually switching devices and adding the microphone track to an audio element to hear it played back.

The third snippet is almost identical to the first except instead of immediately stopping the tracks and throwing away the stream, it keeps the stream around and stops the tracks 2 seconds later.  With this test, I was once able to get getUserMedia() to get into a state where it would inconsistently switch back and forth between the built-in mic and the AirPods. It doesn't happen always so I'm a bit baffled how/when/why it can get into that state (which still isn't ideal), but thought it worth including.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20241111/fc8c4c9b/attachment.htm>


More information about the webkit-unassigned mailing list