[Webkit-unassigned] [Bug 84687] Add multichannel support for input of JavaScriptAudioNode

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Apr 26 19:26:37 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=84687





--- Comment #5 from Chris Rogers <crogers at google.com>  2012-04-26 19:26:37 PST ---
(From update of attachment 138525)
View in context: https://bugs.webkit.org/attachment.cgi?id=138525&action=review

>> Source/WebCore/Modules/webaudio/JavaScriptAudioNode.cpp:65
>>          return 0;
> 
> Hi Chris, as you said, whether should we handle numberOfOutputChannels == 0?
> Now numberOfOutputChannels==0 is not allowed here.

I think for now we'll have to enforce that numberOfOutputChannels > 0.  But we might want to consider Raymond's work with the AudioBasicInspectorNode (later on - not important right now) where it might be possible to create a JavaScriptAudioNode with zero channels of output which gets automatically pulled.

So for now, I think we still need this check.

>> Source/WebCore/Modules/webaudio/JavaScriptAudioNode.cpp:109
>>          m_outputBuffers.append(AudioBuffer::create(this->output(0)->numberOfChannels(), bufferSize(), sampleRate));
> 
> Maybe need to check this->output(0)->numberOfChannels() > 0 here?

Yes, one way to handle this code would be:

RefPtr<AudioBuffer> inputBuffer = m_numberOfInputChannels ? AudioBuffer::create(m_numberOfInputChannels, bufferSize(), sampleRate) : 0;
RefPtr<AudioBuffer> outputBuffer = m_numberOfOutputChannels ? AudioBuffer::create(m_numberOfOutputChannels, bufferSize(), sampleRate) : 0;

m_inputBuffers.append(inputBuffer);
m_outputBuffers.append(outputBuffer);

*** please note I've created new instance variables m_numberOfInputChannels and m_numberOfOutputChannels because it seems like the code will be cleaner this way...

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list