4
votes

I'm trying to share the computer's audio via webRTC and GetUserMedia, but I don't know if it is possible to obtain this stream.

On Linux and Firefox, when I request the GetUserMedia with the following constrains

navigator.mediaDevices.getUserMedia({video: false, audio:true})

In the popup I can choose alsa_output.pci and share the computer's audio. But when I tried on Chrome/Chromium or I changed to Windows neither Firefox nor Chrome show me any option to capture the internal audio, only my headset microphone.

Are there any option for the getUserMedia or any workaround to get this audio? I tried all the examples of WebRTC samples and Muaz's examples but no one displayed me this option, only Firefox under Linux.

1
The only solution I found to this answer is using a Loopback input as StereoMix on Windows. Then it is possible to capture this input with the GetUserMedia. But all I found is configuring the SO or install some app for the loopback.RataDP
The annoying thing is that Google Hangouts (which uses WebRTC) actually shows a option "Built-in output" as audio source in Chrome on Mac.Ludo - Off the record
@Ludo And hangouts can share the screen without extension nor special flags. They just build an special options for hangouts :sRataDP

1 Answers

0
votes

There's no way to do this from the JavaScript code.

In Windows, you just have to use as input for WebRTC Stereo mix (or Wave out mix on some laptops/sound cards). If you don't have it on your list of recording devices, try to update your sound card driver. If you do have it in the list, but it is marked as Currently unavailable, then right click on it and select Set as Default Device. This would make it available.

If your sound card doesn't support Stereo mix, then you can use something like Virtual Audio Cable.