Skip to content

Commit

Permalink
- fix #624
Browse files Browse the repository at this point in the history
  • Loading branch information
christoph-hart committed Jan 21, 2025
1 parent f16a2cf commit 550400e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions hi_faust/FaustWrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ template <int NV, class ParameterClass> struct faust_base_wrapper
}

// std::string code;
int sampleRate;
int sampleRate = 0;

// This contains a faust instance for each voice
PolyData<::faust::dsp*, NumVoices> faustDsp;
Expand Down Expand Up @@ -111,9 +111,10 @@ template <int NV, class ParameterClass> struct faust_base_wrapper
return;

if (_nChannels != specs.numChannels || _nFramesMax != specs.blockSize) {
DBG("Faust: Resizing buffers: nChannels=" << _nChannels << ", blockSize=" << _nFramesMax);

_nChannels = specs.numChannels;
_nFramesMax = specs.blockSize;
DBG("Faust: Resizing buffers: nChannels=" << _nChannels << ", blockSize=" << _nFramesMax);
resizeBuffer();
}

Expand Down Expand Up @@ -145,6 +146,9 @@ template <int NV, class ParameterClass> struct faust_base_wrapper
// to encode both input and output channels into a single integer using a magic trick
auto encodedChannelCount = 1000 * numInputs + numOutputs;

// Reset the sample rate so that it will be initialised the next prepare() call
sampleRate = 0;

scriptnode::Error::throwError(Error::IllegalFaustChannelCount, numHiseChannels, encodedChannelCount);
}
}
Expand Down

0 comments on commit 550400e

Please sign in to comment.