Comments (6)
Thanks for the report. This is a great test.
from labsound.
thanks and I did find a silly thing - forgot to say musicClip->start(0);
But then the problems started (and more like what I'm seeing in my main application), here I reworked the test a bit
ac.connect(splitter, musicClipNode); gain->gain()->setValue(1.0f); ac.connect(gain, splitter, 0, 1); ac.connect(merger, splitter, 1, 0); // A ac.connect(merger, gain, 0, 0); // B ac.connect(context->device(), merger, 0, 0); musicClipNode->start(0);
If I comment out // A or // B I get some output. If I leave them both in, it crashes on the second one, something about an index / array out of bounds.
And of the output I get with just one, it sounds monophonic - equal in both ears. I was expecting it to be left front or right front.
from labsound.
for reference, I see that channel merger is supposed to generate a single output with as many channels as inputs, unless a different output channel count is specified in construction.
LabSound doesn't have that constructor variant, but it does have
void setOutputChannelCount(int n) { m_desiredNumberOfOutputChannels = n; }
The constructor starts with a single channel output instead of numberOfInputs, so that's an error
ChannelMergerNode::ChannelMergerNode(AudioContext & ac, int numberOfInputs_)
: AudioNode(ac, *desc())
, m_desiredNumberOfOutputChannels(1
so that explains the mono output.
Subsequently, I see that the processing loop increments outputChannelIndex and does not test against the actual number outputChannels.
I think I understand the spec to say
let a = number of input channels
let b = number of output channels
if a == b copy 1:1
if a < b copy 1:1 up to a, then zero the other channels
if b < a copy 1:1 up to b, then ignore the other channels
if that matches what you think it should do, we can go with that
from labsound.
It matches, lets go with it - thanks for taking it on
from labsound.
Ok, pushed to top of tree. It's crash free, and the splitter & merger are now working to spec. I modified the sample to swap the left and right channels (so front left comes from the front right speaker, and vice versa) to make it obvious it's working.
from labsound.
This is in the 1.2 release. Please reopen the issue if you encounter problems!
from labsound.
Related Issues (20)
- QOA to shrink the HRTF database?
- WaveShaperNode missing oversample property? HOT 1
- Cmake doesn't work in windows for latest main branch commits HOT 2
- HRTF loader doesn't return boolean false if .wav not found HOT 5
- AudioNodeOutput->bus(r) returns m_inPlacebus instead of m_internalBus HOT 1
- ChannelSplitter/Merger - can only get first 2 channels from 6 channel Bus HOT 2
- miniaudio backend upgrade
- Simple example to play a wav file? HOT 2
- ADSRNode issues HOT 7
- oscillator waveforms are not band limited HOT 6
- DynamicsCompressorNode crashes if input and output has different number of channels HOT 1
- No ConstantNode HOT 2
- disconnecting and reconnecting nodes seems to break connection HOT 6
- WaveShaperNode seems to cause memory corruption while upsampling and subsequently SEGFAULTs HOT 35
- PannerNode HRTF constructor HOT 3
- LOG_PRINT should replace ASN_PRINT, printf, and std::iostream HOT 4
- Logger is in global namespace HOT 2
- CMake defaults to MD runtime HOT 5
- PingPongDelayNode issue HOT 4
- HRTF example has a resampling bug HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from labsound.