Difference between window.AudioContext and navigator.getUserMedia

I have searched and read several articles found via google search but cannot find the pending answer.

Apart from initiation, what is the difference between the .AudioContext window and navigator.getUserMedia?

Also I already know that getUserMedia can be used to get the camera stream, but this is more about audio volume. Browser support information will be very helpful too.

+3


source to share


2 answers


There is a big difference between window.AudioContext

and navigator.getUserMedia

. GetUserMedia gives you an audio stream generated in terms of a MediaStream object, whereas AudioContext is mainly used in terms of audio processing. You will also get supported browsers in the links provided.



+1


source


getUserMedia () gets input from microphones, camera, or other locations (screencaptures (which will include audio recording soon), etc.). It creates a MediaStream (with one or more MediaStreamTracks). You can also create MediaStreams from media elements (element.captureStream () / etc) or canvases (canvas.captureStream (...) - obviously only video). Note that captureStream () is in the process of being included in the specifications for MediaStreams.

AudioContext is a grouping structure for WebAudio plots. This is not a source or even a processing node, it is the context (graph) in which the WebAudio code is running. You can feed the MediaStream (audio tracks) to the WebAudio AudioContext, or use other recorded or synthetic inputs / generators.



Very different designs.

+1


source







All Articles