Code Monkey home page Code Monkey logo

Comments (6)

meshula avatar meshula commented on June 2, 2024

Thanks for the report. This is a great test.

from labsound.

dug9 avatar dug9 commented on June 2, 2024

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.

meshula avatar meshula commented on June 2, 2024

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.

dug9 avatar dug9 commented on June 2, 2024

It matches, lets go with it - thanks for taking it on

from labsound.

meshula avatar meshula commented on June 2, 2024

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.

meshula avatar meshula commented on June 2, 2024

This is in the 1.2 release. Please reopen the issue if you encounter problems!

from labsound.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.