From 3146e838e0013672f5f5b55cf81dd8ea90b47034 Mon Sep 17 00:00:00 2001 From: KubaPro010 Date: Tue, 30 Dec 2025 22:29:08 +0100 Subject: [PATCH] =?UTF-8?q?more=20variables=20=F0=9F=AB=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/fm95.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/fm95.c b/src/fm95.c index 5eaecc8..b627e43 100644 --- a/src/fm95.c +++ b/src/fm95.c @@ -491,15 +491,21 @@ void init_runtime(FM95_Runtime* runtime, const FM95_Config config) { float last_gain = 0.0f; float last_power = 0.0f; uint8_t last_compress = 0; + uint8_t last_sample_counter = 0; + uint8_t last_second_counter = 0; if(runtime->bs412.sample_rate == config.sample_rate) { last_gain = runtime->bs412.gain; last_power = runtime->bs412.avg_power; last_compress = runtime->bs412.can_compress; + last_sample_counter = runtime->bs412.sample_counter; + last_second_counter = runtime->bs412.second_counter; } init_bs412(&runtime->bs412, config.mpx_deviation, config.mpx_power, config.bs412_attack, config.bs412_release, config.bs412_max, config.sample_rate); runtime->bs412.gain = last_gain; runtime->bs412.avg_power = last_power; runtime->bs412.can_compress = last_compress; + runtime->bs412.sample_counter = last_sample_counter; + runtime->bs412.second_counter = last_second_counter; init_stereo_encoder(&runtime->stencode, 4.0f, &runtime->osc, config.volumes.audio, config.volumes.pilot);