相关文章推荐
淡定的蚂蚁  ·  numpy ...·  1 年前    · 
讲道义的高山  ·  Phi和psi_百度知道·  1 年前    · 
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

I've searched and read a few articles found through Google search, but can't find a laid out answer.

Besides initiation what is the difference between window.AudioContext and navigator.getUserMedia?

Also I already know getUserMedia can be used to also get camera stream, but this is more in the scope of audio. Browser support info would also be very helpful.

getUserMedia() gets input data from microphones, camera or other locations (screencaptures (which will include audio capture 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 video only). Note that captureStream() is in the process of being incorporated into the specs for MediaStreams.

An AudioContext is the grouping construct for WebAudio graphs. It isn't a source or even a processing node, it's a context (graph) the WebAudio code works in. You can feed a MediaStream (the audio tracks thereof) into a WebAudio AudioContext, or use other recorded or synthetic inputs/generators.

Very different constructs.

Encoding wise, does that mean the streams in the MediaStream object is encoded and that the stream from AudioContext is raw(Straight from the device)? Gerardlamo Jun 24, 2015 at 8:33 @Gerardlamo As far as I know AudioContext cannot create a stream rather it takes stream generated by GetUserMedia and creates MediaNodes using some methods . The methods here can give you a better idea. Obscure Geek Jun 24, 2015 at 9:54

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question . Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers .