Capture system from browser

I am trying to create a web application that captures both local and remote audio from a webrtc call, but I cannot record remote sound (using recordRTC). I was wondering if I could somehow capture the system.

Is there any way to capture the sound of the system (not just the microphone) from the browser. Maybe an extension?

+5
source share
1 answer

In Chrome, chrome.desktopCapture the API extension can be used to capture a screen that includes system sound (but only for Windows and Chrome OS and without OS X or Linux plans ). For instance.

 chrome.desktopCapture.chooseDesktopMedia([ 'screen', 'window' // ('tab' is not supported; use chrome.tabCapture instead) ], function(streamId) { navigator.webkitGetUserMedia({ audio: { mandatory: { chromeMediaSource: 'system', chromeMediaSourceId: streamId } }, video: false, // We only want audio for now. }, function(stream) { // Do what you want with this MediaStream. }, function(error) { // Handle error }); }); 

I'm not sure that Firefox can capture system sound, but at least it is capable of capturing some results (tab / window / browser / OS?). First you need to visit about:config and set media.getusermedia.audiocapture.enabled to true (this can be automated using the Firefox add-on). Then the stream can be written as follows:

 navigator.mozGetUserMedia({ audio: { mediaSource: 'audioCapture' }, video: false, // Just being explicit, we only want audio for now }, function(stream) { // Do what you want with this MediaStream. }, function(error) { // Handle error }); 

This was implemented in Firefox 42, https://bugzilla.mozilla.org/show_bug.cgi?id=1156472

+4
source

Source: https://habr.com/ru/post/1237962/


All Articles