mirror of
https://github.com/radio95-rnt/fm95.git
synced 2026-02-27 03:23:54 +01:00
bug
This commit is contained in:
@@ -9,6 +9,7 @@ void initAGC(AGC* agc, int sampleRate, float targetLevel, float minGain, float m
|
|||||||
agc->releaseCoef = expf(-1.0f / (sampleRate * releaseTime));
|
agc->releaseCoef = expf(-1.0f / (sampleRate * releaseTime));
|
||||||
agc->rmsAlpha = expf(-1.0f / (sampleRate * 0.025f));
|
agc->rmsAlpha = expf(-1.0f / (sampleRate * 0.025f));
|
||||||
agc->rmsBeta = 1.0f - agc->rmsAlpha;
|
agc->rmsBeta = 1.0f - agc->rmsAlpha;
|
||||||
|
agc->sampleRate = sampleRate;
|
||||||
|
|
||||||
agc->currentGain = 1.0f;
|
agc->currentGain = 1.0f;
|
||||||
agc->currentLevel = 0.0f;
|
agc->currentLevel = 0.0f;
|
||||||
|
|||||||
@@ -454,7 +454,7 @@ void init_runtime(FM95_Runtime* runtime, FM95_Config config, bool rds_on) {
|
|||||||
init_stereo_encoder(&runtime->stencode, 4.0f, &runtime->osc, (config.stereo == 2), config.volumes.mono, config.volumes.pilot, config.volumes.stereo);
|
init_stereo_encoder(&runtime->stencode, 4.0f, &runtime->osc, (config.stereo == 2), config.volumes.mono, config.volumes.pilot, config.volumes.stereo);
|
||||||
|
|
||||||
if(config.agc_max != 0.0) {
|
if(config.agc_max != 0.0) {
|
||||||
last_gain = 0.0f;
|
last_gain = 1.0f;
|
||||||
if(runtime->agc.sampleRate == config.sample_rate) last_gain = runtime->agc.currentGain;
|
if(runtime->agc.sampleRate == config.sample_rate) last_gain = runtime->agc.currentGain;
|
||||||
initAGC(&runtime->agc, config.sample_rate, config.agc_target, config.agc_min, config.agc_max, config.agc_attack, config.agc_release);
|
initAGC(&runtime->agc, config.sample_rate, config.agc_target, config.agc_min, config.agc_max, config.agc_attack, config.agc_release);
|
||||||
runtime->agc.currentGain = last_gain;
|
runtime->agc.currentGain = last_gain;
|
||||||
|
|||||||
Reference in New Issue
Block a user