You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When working with 6 channel source audioBus, SampledAudioNode goes through a bit of code to prepare itself to receive all the channels of the input: bool mess = false; if (dstChannelCount != srcChannelCount) { mess = true; output(0)->setNumberOfChannels(r, srcChannelCount); dstChannelCount = srcChannelCount; dstBus = output(0)->bus(r); } if (mess) printf("1 dstBus nchan %d\n", dstBus->numberOfChannels());
AudioNodeOutput->setNumberOfChannels works great, resetting m_internalBus to a fresh bus with 6 channels in my case.
Then the problem: output(0)->bus(r) returns something with 2 channels, and code below -confused- bombs. AudioBus * AudioNodeOutput::bus(ContextRenderLock & r) const { // only legal during rendering because an in-place bus might have been supplied to pull ASSERT(r.context()); //return m_inPlaceBus ? m_inPlaceBus : m_internalBus.get(); // HAS BEEN RETURNING INPLACEBUS WITH M_CHAN 2 return m_internalBus.get(); }
When I modify the function to return m_internalBus and ignor m_inPlaceBus, then my scene runs normally, sound out, and with channelSplitter, channelMerger I'm able to have fun swapping channels around.
Q1. do I need m_internalBus or can I keep it commented out and live happily ever after?
Q2. if I need it, is there something I can do from my application code to clear it before associating AudioBus with SampledAudioNode?
Thanks.
The text was updated successfully, but these errors were encountered:
In the case of a SampledAudioNode, the internalBus will always be what you want. The inPlace is an optimization for pass through nodes (ie. a gain node set to 1.0 could in theory just pass on a pointer to an upstream bus and thus save copying a buffer).
Your patch should work for now, but I will review the logic around the in place bus. It is a remnant from the original WebKit implementation, and might be best removed at this point.
When working with 6 channel source audioBus, SampledAudioNode goes through a bit of code to prepare itself to receive all the channels of the input:
bool mess = false; if (dstChannelCount != srcChannelCount) { mess = true; output(0)->setNumberOfChannels(r, srcChannelCount); dstChannelCount = srcChannelCount; dstBus = output(0)->bus(r); } if (mess) printf("1 dstBus nchan %d\n", dstBus->numberOfChannels());
AudioNodeOutput->setNumberOfChannels works great, resetting m_internalBus to a fresh bus with 6 channels in my case.
Then the problem: output(0)->bus(r) returns something with 2 channels, and code below -confused- bombs.
AudioBus * AudioNodeOutput::bus(ContextRenderLock & r) const { // only legal during rendering because an in-place bus might have been supplied to pull ASSERT(r.context()); //return m_inPlaceBus ? m_inPlaceBus : m_internalBus.get(); // HAS BEEN RETURNING INPLACEBUS WITH M_CHAN 2 return m_internalBus.get(); }
When I modify the function to return m_internalBus and ignor m_inPlaceBus, then my scene runs normally, sound out, and with channelSplitter, channelMerger I'm able to have fun swapping channels around.
Q1. do I need m_internalBus or can I keep it commented out and live happily ever after?
Q2. if I need it, is there something I can do from my application code to clear it before associating AudioBus with SampledAudioNode?
Thanks.
The text was updated successfully, but these errors were encountered: