Bug 76431

Summary: Feature request: Be able to retrieve data from specific channel with RealtimeAnalyserNode
Product: WebKit Reporter: Raymond <rgbbones>
Component: Web AudioAssignee: Nobody <webkit-unassigned>
Status: RESOLVED INVALID    
Severity: Normal CC: crogers
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   

Description Raymond 2012-01-17 00:12:48 PST
It seems to me that RealtimeAnalyserNode is working on left channel at present, though these is a Fixme mentioned to mix right channel for stereo case. But I guess a mixed data doesn't really mean anything in the case of real time analyse? Is that possible to change the spec so that the data can be retrieved per dedicated channel upon request?

Well, I know you can probably bypass this issue by channel splitter, but seems a little bit tricky, and might not be flexible enough.
Comment 1 Chris Rogers 2012-01-17 10:18:16 PST
Actually, I think that we *do* want to mix stereo to mono and then analyse that instead of just taking the left channel.  For individual channel analysis, a splitter can get us any specific channel.
Comment 2 Raymond 2012-01-17 16:50:52 PST
(In reply to comment #1)
> Actually, I think that we *do* want to mix stereo to mono and then analyse that instead of just taking the left channel.  For individual channel analysis, a splitter can get us any specific channel.

Ok, if the design is to use channel splitter to do the work, fine. ;)

While , at least we might need to eliminate the need to connect the RealtimeAnalyserNode to a destination node somehow in order to make it pull the data? It's annoying that I need to connect it through a 0 gain node to mute it out...
Comment 3 Chris Rogers 2012-01-17 17:19:08 PST
(In reply to comment #2)
> (In reply to comment #1)
> > Actually, I think that we *do* want to mix stereo to mono and then analyse that instead of just taking the left channel.  For individual channel analysis, a splitter can get us any specific channel.
> 
> Ok, if the design is to use channel splitter to do the work, fine. ;)
> 
> While , at least we might need to eliminate the need to connect the RealtimeAnalyserNode to a destination node somehow in order to make it pull the data? It's annoying that I need to connect it through a 0 gain node to mute it out...

Yes, that's true.  It might take a little work to implement, but could be nice.
Comment 4 Raymond 2012-01-17 17:29:23 PST
(In reply to comment #3)
> (In reply to comment #2)
> > (In reply to comment #1)
> > > Actually, I think that we *do* want to mix stereo to mono and then analyse that instead of just taking the left channel.  For individual channel analysis, a splitter can get us any specific channel.
> > 
> > Ok, if the design is to use channel splitter to do the work, fine. ;)
> > 
> > While , at least we might need to eliminate the need to connect the RealtimeAnalyserNode to a destination node somehow in order to make it pull the data? It's annoying that I need to connect it through a 0 gain node to mute it out...
> 
> Yes, that's true.  It might take a little work to implement, but could be nice.

so do you have any idea on this, or I can try this work ;)
Comment 5 Chris Rogers 2012-01-17 17:39:44 PST
(In reply to comment #4)
> (In reply to comment #3)
> > (In reply to comment #2)
> > > (In reply to comment #1)
> > > > Actually, I think that we *do* want to mix stereo to mono and then analyse that instead of just taking the left channel.  For individual channel analysis, a splitter can get us any specific channel.
> > > 
> > > Ok, if the design is to use channel splitter to do the work, fine. ;)
> > > 
> > > While , at least we might need to eliminate the need to connect the RealtimeAnalyserNode to a destination node somehow in order to make it pull the data? It's annoying that I need to connect it through a 0 gain node to mute it out...
> > 
> > Yes, that's true.  It might take a little work to implement, but could be nice.
> 
> so do you have any idea on this, or I can try this work ;)

I'm sure it can be solved, but somehow the AudioContext has to keep track of such unconnected RealtimeAnalyserNodes, so it can "artificially" pull them.  But, then we have to be careful about the lifetime of them...  You can think about it if you like.  There might be other such nodes in the future, such as a MeteringNode to measure signal level.
Comment 6 Raymond 2012-01-17 17:59:16 PST
channel splitter should do the work