View Single Post
Old 06-21-2015, 04:43 PM   #15
Human being with feelings
Join Date: Jun 2015
Posts: 348

So after switching to queues the original problem still persists with the following code, which produces exactly the same that the original code in post #1:

outputBuffer has been initialized with FFT_BUFFER_SIZE of 0.0s.

void IPlugSideChain::ProcessDoubleReplacing(double** inputs, double** outputs, int nFrames) {
// Mutex is already locked for us.

        double* in1 = inputs[0];
        double* out1 = outputs[0];

        // nFrames to processingBuffer

        // output nFrames from outputBuffer
	outputBuffer.GetToBuf(0, reinterpret_cast<char*>(out1), nFrames*sizeof(double));

	if (processingBuffer.Available() > sizeof(double)*FFT_BUFFER_SIZE) {

                // Read out FFT sized chunk from processingBuffer
		double data[FFT_BUFFER_SIZE];
		processingBuffer.GetToBuf(0, reinterpret_cast<char*>(data), FFT_BUFFER_SIZE*sizeof(double));

		hamming(data, FFT_BUFFER_SIZE);

                // Add processed data to outputBuffer
	        outputBuffer.Add(reinterpret_cast<char*>(data), FFT_BUFFER_SIZE*sizeof(double));
I don't get what I'm doing wrong.

Also reinterpret_cast seems not necessary? Why?

Last edited by mviljamaa; 06-21-2015 at 09:30 PM.
mviljamaa is offline   Reply With Quote