1

I am trying to access my computer's audio source in order to stream to a back end server. I am using the tutorial found here which uses a webKitAudioContext object to facilitate this connection.

I'm confused by the stream object, however. First off, in the webkitGetUserMedia method, the callback function is called without this parameter. Second, the instructions on the web page read

"We ask, using getUserMedia, for access to the microphone. If this is successful our callback gets called with the audio stream as its parameter."

Can anyone tell me what this stream variable is/where it is supposed to come from? This is my first foray into streaming audio, so sorry if this is a n00b question. :)

      function callback(stream) {
           var context = new webkitAudioContext();
           var mediaStreamSource = context.createMediaStreamSource(stream);
           ...
       }

       $(document).ready(function() {
           navigator.webkitGetUserMedia({audio:true}, callback);
           ...
       }

EDIT

Apparently this is some sort of "implied" parameter that evaluates to the following in the console:

LocalMediaStream {onremovetrack: null, onaddtrack: null, onended: null, ended: false, id: "zr0ZH5b0YZy6gjTGyaKdncl5XYFYT2LsAEPS"…}

I'm still new to this whole streaming thing, so anyone with some more info on what this object is I'd much appreciate it. Thanks!

random
  • 125
  • 1
  • 7

0 Answers0