Re: [discuss-webrtc] How to get microphone and video data together from the same page

65 views
Skip to first unread message
Message has been deleted

Dennis E. Dowhy

unread,
May 18, 2013, 7:13:44 AM5/18/13
to discuss...@googlegroups.com
Why don't you just try to set them both to true and make the call to get user media only once? E.g. "audio: true, video: true"?

Sent from my iPhone

On May 18, 2013, at 5:36 AM, Ket <kett...@gmail.com> wrote:

audio: false, video: true

Ket Nonting

unread,
May 18, 2013, 7:18:26 AM5/18/13
to discuss...@googlegroups.com
Thanks,

I've tired that. It's not working.


--
 
---
You received this message because you are subscribed to a topic in the Google Groups "discuss-webrtc" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/discuss-webrtc/YXQwU8Ycrh4/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to discuss-webrt...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Meldville

Dennis E. Dowhy

unread,
May 18, 2013, 7:34:07 AM5/18/13
to discuss...@googlegroups.com
I can't speak to your individual case but that should most definitely work. If it doesn't then there may be something uniquely different about your configuration.  Do you supply an error callback to getUserMedia and print out the error info? If exceptions are being thrown it may also help to look at console output (control-shift-j in chrome) or even go into the sources in the chrome debugger utils (see sources tab in the console) and set breakpoints around the problem areas to inspect local variables and the event parameters being sent to the callback methods. 

Alternatively, you could start chrome from a command prompt window with the flags for enabling logging to get more detailed traces about what's actually going wrong. If using canary chrome version you can get detailed logs by starting with
chrome --enable-logging --v=3 --vmodule=*libjingle/source/talk/*=3
the chrome_debug.log file gets created in the user data directory. 
http://dev.chromium.org/user-experience/user-data-directory


Sent from my iPhone
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.

Ket Nonting

unread,
May 18, 2013, 9:30:18 AM5/18/13
to discuss...@googlegroups.com
Thanks Dennis,

The console.log() method is very helpful.

Ket Nonting

unread,
May 18, 2013, 9:43:46 AM5/18/13
to discuss...@googlegroups.com
On the other note: I cannot manipulate microphone with Audio API like ScriptProcessorNode if I set "audio: true, video: true". It can be done only if you write functions separately.

Vikas

unread,
May 20, 2013, 2:37:53 PM5/20/13
to discuss-webrtc
Hi Ket,

You probably need an audio only stream for web Audio api's. You can
try create a new audio only stream from the audio & video stream you
got from getusermedia.
var audiostream = new webkitMediaStream([stream.getAudioTracks()
[0]]);

/Vikas

On May 18, 6:43 am, Ket Nonting <kettin...@gmail.com> wrote:
> On the other note: I cannot manipulate microphone with Audio API like
> ScriptProcessorNode if I set "audio: true, video: true". It can be done only
> if you write functions separately.
>
>
>
>
>
>
>
>
>
> On Sat, May 18, 2013 at 8:30 PM, Ket Nonting <kettin...@gmail.com> wrote:
> > Thanks Dennis,
>
> > The console.log() method is very helpful.
>
> > On Sat, May 18, 2013 at 6:34 PM, Dennis E. Dowhy <ddo...@gmail.com> wrote:
>
> >> I can't speak to your individual case but that should most definitely
> >> work. If it doesn't then there may be something uniquely different about
> >> your configuration.  Do you supply an error callback to getUserMedia and
> >> print out the error info? If exceptions are being thrown it may also help
> >> to look at console output (control-shift-j in chrome) or even go into the
> >> sources in the chrome debugger utils (see sources tab in the console) and
> >> set breakpoints around the problem areas to inspect local variables and the
> >> event parameters being sent to the callback methods.
>
> >> Alternatively, you could start chrome from a command prompt window with
> >> the flags for enabling logging to get more detailed traces about what's
> >> actually going wrong. If using canary chrome version you can get detailed
> >> logs by starting with
>
> >> chrome --enable-logging --v=3 --vmodule=*libjingle/source/talk/*=3
>
> >> the chrome_debug.log file gets created in the user data directory.
>
> >>http://dev.chromium.org/user-experience/user-data-directory
>
> >> Sent from my iPhone
>
> >> On May 18, 2013, at 7:18 AM, Ket Nonting <kettin...@gmail.com> wrote:
>
> >> Thanks,
>
> >> I've tired that. It's not working.
>
> >> On Sat, May 18, 2013 at 6:13 PM, Dennis E. Dowhy <ddo...@gmail.com>wrote:
>
> >>> Why don't you just try to set them both to true and make the call to get
> >>> user media only once? E.g. "audio: true, video: true"?
>
> >>> Sent from my iPhone
>
> >>> On May 18, 2013, at 5:36 AM, Ket <kettin...@gmail.com> wrote:
>
> >>> audio: false, video: true
>
> >>>  --
>
> >>> ---
> >>> You received this message because you are subscribed to a topic in the
> >>> Google Groups "discuss-webrtc" group.
> >>> To unsubscribe from this topic, visit
> >>>https://groups.google.com/d/topic/discuss-webrtc/YXQwU8Ycrh4/unsubscr...
> >>> .
> >>> To unsubscribe from this group and all its topics, send an email to
> >>> discuss-webrt...@googlegroups.com.
> >>> For more options, visithttps://groups.google.com/groups/opt_out.
>
> >> --
> >> Meldville <http://www.meldville.com>
>
> >> --
>
> >> ---
> >> You received this message because you are subscribed to the Google Groups
> >> "discuss-webrtc" group.
> >> To unsubscribe from this group and stop receiving emails from it, send an
> >> email to discuss-webrt...@googlegroups.com.
>
> >> For more options, visithttps://groups.google.com/groups/opt_out.
>
> >>  --
>
> >> ---
> >> You received this message because you are subscribed to a topic in the
> >> Google Groups "discuss-webrtc" group.
> >> To unsubscribe from this topic, visit
> >>https://groups.google.com/d/topic/discuss-webrtc/YXQwU8Ycrh4/unsubscr...
> >> .
> >> To unsubscribe from this group and all its topics, send an email to
> >> discuss-webrt...@googlegroups.com.
> >> For more options, visithttps://groups.google.com/groups/opt_out.
>
> > --
> > Meldville <http://www.meldville.com>
>
> --
> Meldville <http://www.meldville.com>
Message has been deleted
Message has been deleted

Vikas

unread,
May 21, 2013, 8:15:39 PM5/21/13
to discuss-webrtc
Hi,

What platform you tested on, with the code you shared i was able to
hear audio on Mac latest canary. You should take a look at this
WebAudio + WebRTC demo:- http://webrtc.googlecode.com/svn/trunk/samples/js/demos/html/webaudio-and-webrtc.html.
If you tested on windows, Sample rate and channel configuration must
be the same for input and output sides on Windows.

/Vikas

On May 21, 7:05 am, Ket <kettin...@gmail.com> wrote:
> > var context = new webkitAudioContext()
> >   , node = context.createScriptProcessor(2048, 1, 1)
> >   , video = document.querySelector('video')
> >   ;
>
> > navigator.webkitGetUserMedia({audio: false, video: true}, function(xtream)
> > {
> >     video.src = URL.createObjectURL(xtream);
> > });
>
> > navigator.webkitGetUserMedia({audio: true, video: false}, function(stream)
> > {
> >     var microphone = context.createMediaStreamSource(stream);
> >     microphone.connect(node);
> >     var audiostream = new webkitMediaStream([stream.getAudioTracks()[1]]);
> > });
>
> > node.onaudioprocess = function (e) {
> >   var intput = e.inputBuffer.getChannelData(0)
> >     , output = e.outputBuffer.getChannelData(0);
> >   for (var i = 0; i < output.length; i++) {
> >     output[i] = intput[i];
> >   }
> > };
> > node.connect(context.destination);

Ket

unread,
May 21, 2013, 9:17:04 PM5/21/13
to discuss...@googlegroups.com
Thanks Vikas,

I test it on Windows and on both chrome canary and beta.
Reply all
Reply to author
Forward
0 new messages