Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexandreRouma committed Feb 15, 2023
1 parent 38b3b28 commit b27c25e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/dsp/compression/sample_stream_compressor.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ namespace dsp::compression {
if (pcmType == PCMType::PCM_TYPE_F32) {
*scaler = 0;
memcpy(dataBuf, in, count * sizeof(complex_t));
return count;
return 8 + (count * sizeof(complex_t));
}

// Find maximum value
Expand Down
3 changes: 3 additions & 0 deletions src/dsp/loop/agc.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ namespace dsp::loop {
amp = (inAmp > amp) ? ((amp * _invAttack) + (inAmp * _attack)) : ((amp * _invDecay) + (inAmp * _decay));
gain = std::min<float>(_setPoint / amp, _maxGain);
}
else {
gain = 1.0f;
}

// If clipping is detected look ahead and correct
if (inAmp*gain > _maxOutputAmp) {
Expand Down
2 changes: 1 addition & 1 deletion src/dsp/multirate/rational_resampler.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ namespace dsp::multirate {
double actualOutSR = (double)IntSR * (double)interp / (double)decim;
double error = abs((actualOutSR - _outSamplerate) / _outSamplerate) * 100.0;
if (error > 0.01) {
fprintf(stderr, "Warning: resampling error is over 0.01%: %lf\n", error);
fprintf(stderr, "Warning: resampling error is over 0.01%%: %lf\n", error);
}

// If the power decimator already did all the work, don't use the resampler
Expand Down

0 comments on commit b27c25e

Please sign in to comment.