0
1
mirror of https://github.com/radio95-rnt/fm95.git synced 2026-02-27 03:23:54 +01:00
This commit is contained in:
2025-03-08 21:23:23 +01:00
parent 21b009f68b
commit 2b720500de
3 changed files with 3 additions and 43 deletions

View File

@@ -21,7 +21,6 @@
#include "../lib/filters.h"
#include "../lib/fm_modulator.h"
#define INPUT_SAMPLE_RATE 32000 // make sure that the output is a multiple of this
#define SAMPLE_RATE 192000
#define INPUT_DEVICE "FM_Audio.monitor"
@@ -239,12 +238,6 @@ int main(int argc, char **argv) {
.channels = 1,
.rate = SAMPLE_RATE
};
pa_sample_spec main_input_format = {
.format = PA_SAMPLE_FLOAT32NE,
.channels = 2,
.rate = INPUT_SAMPLE_RATE
};
pa_buffer_attr input_buffer_atr = {
.maxlength = buffer_maxlength,
@@ -266,7 +259,7 @@ int main(int argc, char **argv) {
PA_STREAM_RECORD,
audio_input_device,
"Main Audio Input",
&main_input_format,
&stereo_format,
NULL,
&input_buffer_atr,
&opentime_pulse_error
@@ -382,10 +375,6 @@ int main(int argc, char **argv) {
BiquadFilter lpf_l, lpf_r;
init_lpf(&lpf_l, LPF_CUTOFF, 0.70710678f, SAMPLE_RATE);
init_lpf(&lpf_r, LPF_CUTOFF, 0.70710678f, SAMPLE_RATE);
Upsampler upsampler_l, upsampler_r;
init_upsampler(&upsampler_l, SAMPLE_RATE/INPUT_SAMPLE_RATE, SAMPLE_RATE);
init_upsampler(&upsampler_r, SAMPLE_RATE/INPUT_SAMPLE_RATE, SAMPLE_RATE);
// #endregion
signal(SIGINT, stop);
@@ -421,8 +410,8 @@ int main(int argc, char **argv) {
}
for (int i = 0; i < BUFFER_SIZE; i++) {
float l_in = upsample(&upsampler_l, left[i]);
float r_in = upsample(&upsampler_r, right[i]);
float l_in = left[i];
float r_in = right[i];
float current_mpx_in = mpx_in[i];
float current_sca_in = sca_in[i];