Fixed bug in AudioEffectAnalogDelay.cpp with regards to gainAdjust() and release null buffers

pull/13/head
Steve Lascos 4 years ago
parent 6575400fbc
commit 6f20a52ce7
  1. 4
      src/LibBasicFunctions.h
  2. 4
      src/effects/AudioEffectAnalogDelay.cpp

@ -88,11 +88,11 @@ void clearAudioBlock(audio_block_t *block);
/// @param mix float between 0.0 and 1.0.
void alphaBlend(audio_block_t *out, audio_block_t *dry, audio_block_t* wet, float mix);
/// Applies a gain to the audio via fixed-point scaling accoring to <br>
/// Applies a gain to the audio via fixed-point scaling according to <br>
/// out = int * (vol * 2^coeffShift)
/// @param out pointer to output audio block
/// @param in pointer to input audio block
/// @param vol volume cofficient between -1.0 and +1.0
/// @param vol volume coefficient between -1.0 and +1.0
/// @param coeffShift number of bits to shift the coefficient
void gainAdjust(audio_block_t *out, audio_block_t *in, float vol, int coeffShift = 0);

@ -151,7 +151,7 @@ void AudioEffectAnalogDelay::update(void)
transmit(blockToOutput);
release(inputAudioBlock);
release(m_previousBlock);
if (m_previousBlock) { release(m_previousBlock); }
m_previousBlock = blockToOutput;
if (m_blockToRelease) release(m_blockToRelease);
@ -255,7 +255,7 @@ void AudioEffectAnalogDelay::m_postProcessing(audio_block_t *out, audio_block_t
memcpy(out->data, dry->data, sizeof(int16_t) * AUDIO_BLOCK_SAMPLES);
}
// Set the output volume
gainAdjust(out, out, m_volume, 1);
gainAdjust(out, out, m_volume);
}

Loading…
Cancel
Save