From 702ee8922b78815b76c79788c8d33f1c5823b7bc Mon Sep 17 00:00:00 2001 From: KubaPro010 Date: Sat, 19 Apr 2025 10:50:04 +0200 Subject: [PATCH] make sure that audio doesn't clip the output, mpx is higher priority --- src/fm95.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/fm95.c b/src/fm95.c index a82bb78..be00a5d 100644 --- a/src/fm95.c +++ b/src/fm95.c @@ -549,6 +549,8 @@ int main(int argc, char **argv) { audio *= (dbr_to_deviation(-excess_power)/mpx_deviation); } + audio = hard_clip(audio, 1-mpx); + output[i] = (audio+mpx)*master_volume; if(rds_on || stereo) advance_oscillator(&osc); }