Closed PascalFaivre closed 1 year ago
We have a dsp_adapter class that could be used for that. And you can find some use-cases like https://github.com/grame-cncm/faust/blob/10ea6212ca539c281fc2fd92da8ccb60ddeec560/architecture/faust/audio/rtaudio-dsp.h#L158 of other places in the repository.
yep, it's good news. I'll watch this
the cause is that the 'compute' function of mydsp assumes that the system has the same number of outputs. But the frame buffer passed to it is initialized only for outputs available on the system :
gOutputs = new FAUSTFLOAT*[context->audioOutChannels]; for (unsigned int ch = 0; ch < context->audioOutChannels; ch++) { gOutputs[ch] = (float*)&context->audioOut[ch * context->audioFrames]; }
By completing the frame buffer of ghostly outputs the program no longer crashes :unsigned int nbDspOutput = gDSP->getNumOutputs(); gOutputs = new FAUSTFLOAT*[nbDspOutput]; for (unsigned int ch = 0; ch < context->audioOutChannels; ch++) { gOutputs[ch] = (float*)&context->audioOut[ch * context->audioFrames]; } for (unsigned int ch = context->audioOutChannels; ch < nbDspOutput; ch++) { float* dummyframes = new float[context->audioFrames]; gOutputs[ch] = dummyframes; }
It's probably the same thing with audio inputs. Would you a PR in this way ?