From c343cb12c8036f84820b9d21b51c8222f704e65e Mon Sep 17 00:00:00 2001 From: Kuba <132459354+KubaPro010@users.noreply.github.com> Date: Fri, 3 Nov 2023 10:23:48 +0000 Subject: [PATCH] more rds volume --- src/pifmrds/fm_mpx.c | 4 ++-- src/pifmrds/fm_mpx.h | 2 +- src/pifmrds/pi_fm_rds.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pifmrds/fm_mpx.c b/src/pifmrds/fm_mpx.c index 2bdd330..8d2d2dc 100644 --- a/src/pifmrds/fm_mpx.c +++ b/src/pifmrds/fm_mpx.c @@ -193,9 +193,9 @@ int fm_mpx_open(char *filename, size_t len, int raw, double preemphasis, int raw // samples provided by this function are in 0..10: they need to be divided by // 10 after. -int fm_mpx_get_samples(float *mpx_buffer, int drds, float compressor_decay, float compressor_attack, float compressor_max_gain_recip, int disablestereo, float gain, int enablecompressor, int rds_ct_enabled) { +int fm_mpx_get_samples(float *mpx_buffer, int drds, float compressor_decay, float compressor_attack, float compressor_max_gain_recip, int disablestereo, float gain, int enablecompressor, int rds_ct_enabled, float rds_volume) { int stereo_capable = (channels > 1) && (!disablestereo); //chatgpt - if(!drds) get_rds_samples(mpx_buffer, length, stereo_capable, rds_ct_enabled, 1.0); + if(!drds) get_rds_samples(mpx_buffer, length, stereo_capable, rds_ct_enabled, rds_volume); if(inf == NULL) return 0; // if there is no audio, stop here diff --git a/src/pifmrds/fm_mpx.h b/src/pifmrds/fm_mpx.h index cbfe292..560f898 100644 --- a/src/pifmrds/fm_mpx.h +++ b/src/pifmrds/fm_mpx.h @@ -22,5 +22,5 @@ */ extern int fm_mpx_open(char *filename, size_t len, int raw, double preemphasis, int rawSampleRate, int rawChannels, float cutoff_freq); -extern int fm_mpx_get_samples(float *mpx_buffer, int drds, float compressor_decay, float compressor_attack, float compressor_max_gain_recip, int disablestereo, float gain, int enablecompressor, int rds_ct_enabled); +extern int fm_mpx_get_samples(float *mpx_buffer, int drds, float compressor_decay, float compressor_attack, float compressor_max_gain_recip, int disablestereo, float gain, int enablecompressor, int rds_ct_enabled float rds_volume); extern int fm_mpx_close(); diff --git a/src/pifmrds/pi_fm_rds.cpp b/src/pifmrds/pi_fm_rds.cpp index bbe52aa..77053cb 100644 --- a/src/pifmrds/pi_fm_rds.cpp +++ b/src/pifmrds/pi_fm_rds.cpp @@ -220,7 +220,7 @@ int tx(uint32_t carrier_freq, char *audio_file, uint16_t pi, char *ps, char *rt, } } - if( fm_mpx_get_samples(data, drds, compressor_decay, compressor_attack, compressor_max_gain_recip, disablestereo, gaim, enablecompressor, rds_ct_enabled) < 0 ) { + if( fm_mpx_get_samples(data, drds, compressor_decay, compressor_attack, compressor_max_gain_recip, disablestereo, gaim, enablecompressor, rds_ct_enabled, 1.0) < 0 ) { terminate(0); } data_len = DATA_SIZE;