mirror of
https://github.com/radio95-rnt/fm95.git
synced 2026-02-26 11:22:00 +01:00
fix minor mistakes
This commit is contained in:
10
src/fm95.c
10
src/fm95.c
@@ -525,14 +525,14 @@ int main(int argc, char **argv) {
|
||||
float mono = (ready_l + ready_r) / 2.0f;
|
||||
audio = mono*MONO_VOLUME;
|
||||
if(stereo) {
|
||||
float stereo = (ready_l - ready_r) / 2.0f;
|
||||
float stereo_signal = (ready_l - ready_r) / 2.0f;
|
||||
float stereo_carrier = get_oscillator_sin_multiplier_ni(&osc, polar_stereo ? 1 : 8); // 31.25 or 38 KHz
|
||||
|
||||
if(polar_stereo) audio += ((stereo+0.2)*stereo_carrier)*STEREO_VOLUME;
|
||||
if(polar_stereo) audio += ((stereo_signal+0.2)*stereo_carrier)*STEREO_VOLUME;
|
||||
else {
|
||||
float pilot = get_oscillator_sin_multiplier_ni(&osc, 4); // 19 KHz
|
||||
mpx += pilot*PILOT_VOLUME;
|
||||
audio += (stereo*stereo_carrier)*STEREO_VOLUME;
|
||||
audio += (stereo_signal*stereo_carrier)*STEREO_VOLUME;
|
||||
}
|
||||
}
|
||||
if(rds_on && polar_stereo == 0) {
|
||||
@@ -545,7 +545,7 @@ int main(int argc, char **argv) {
|
||||
}
|
||||
if(mpx_on) mpx += hard_clip(current_mpx_in, 1.0f)*MPX_VOLUME;
|
||||
if(sca_on) mpx += modulate_fm(&sca_mod, hard_clip(current_sca_in, sca_clipper_threshold))*SCA_VOLUME;
|
||||
if(darc_on) mpx += hard_clip(refrenced_modulate_fm(&darc_modulator, last_darc_data, 16.0f)*compute_darc_amplitude(stereo*STEREO_VOLUME), 0.1f); // should never be over 10%
|
||||
if(darc_on && polar_stereo == 0) mpx += hard_clip(refrenced_modulate_fm(&darc_modulator, last_darc_data, 16.0f)*compute_darc_amplitude(stereo*STEREO_VOLUME), 0.1f); // should never be over 10%, the docs say so
|
||||
|
||||
float mpx_only = measure_mpx(&mpx_only_power, mpx * mpx_deviation);
|
||||
float mpower = measure_mpx(&power, (audio+mpx) * mpx_deviation); // Standard requires that the output is measured specifically
|
||||
@@ -563,7 +563,7 @@ int main(int argc, char **argv) {
|
||||
iirfilt_rrrf_execute(mpx_lpf, audio, &audio);
|
||||
|
||||
output[i] = (audio+mpx)*master_volume;
|
||||
if(rds_on || stereo) advance_oscillator(&osc);
|
||||
if(rds_on || stereo || darc_on) advance_oscillator(&osc);
|
||||
}
|
||||
|
||||
if(write_PulseOutputDevice(&output_device, output, sizeof(output))) {
|
||||
|
||||
Reference in New Issue
Block a user