rds volume?
This commit is contained in:
parent
ea2ae33305
commit
5c0e406dfb
|
|
@ -195,7 +195,7 @@ int fm_mpx_open(char *filename, size_t len, int raw, double preemphasis, int raw
|
|||
// 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 stereo_capable = (channels > 1) && (!disablestereo); //chatgpt
|
||||
if(!drds) get_rds_samples(mpx_buffer, length, stereo_capable, rds_ct_enabled);
|
||||
if(!drds) get_rds_samples(mpx_buffer, length, stereo_capable, rds_ct_enabled, 1.0);
|
||||
|
||||
if(inf == NULL) return 0; // if there is no audio, stop here
|
||||
|
||||
|
|
|
|||
|
|
@ -185,7 +185,7 @@ void get_rds_group(int *buffer, int stereo, int ct_clock_enabled) {
|
|||
envelope with a 57 kHz carrier, which is very efficient as 57 kHz is 4 times the
|
||||
sample frequency we are working at (228 kHz).
|
||||
*/
|
||||
void get_rds_samples(float *buffer, int count, int stereo, int ct_clock_enabled) {
|
||||
void get_rds_samples(float *buffer, int count, int stereo, int ct_clock_enabled, float sample_volume) {
|
||||
static int bit_buffer[BITS_PER_GROUP];
|
||||
static int bit_pos = BITS_PER_GROUP;
|
||||
static float sample_buffer[SAMPLE_BUFFER_SIZE] = {0};
|
||||
|
|
@ -248,7 +248,7 @@ void get_rds_samples(float *buffer, int count, int stereo, int ct_clock_enabled)
|
|||
phase++;
|
||||
if(phase >= 4) phase = 0;
|
||||
|
||||
*buffer++ = sample;
|
||||
*buffer++ = (sample * sample_volume);
|
||||
sample_count++;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
#include <stdint.h>
|
||||
|
||||
extern void get_rds_samples(float *buffer, int count, int stereo, int ct_clock_enabled);
|
||||
extern void get_rds_samples(float *buffer, int count, int stereo, int ct_clock_enabled, float sample_volume=1.0);
|
||||
extern void set_rds_pi(uint16_t pi_code);
|
||||
extern void set_rds_rt(char *rt);
|
||||
extern void set_rds_ps(char *ps);
|
||||
|
|
|
|||
Loading…
Reference in New Issue