mirror of
https://github.com/radio95-rnt/fm95.git
synced 2026-07-30 00:09:16 +02:00
fix this mess of libraries
This commit is contained in:
+3
-3
@@ -4,14 +4,14 @@
|
||||
#include <signal.h>
|
||||
#include <string.h>
|
||||
#include <stdbool.h>
|
||||
#include "../inih/ini.h"
|
||||
#include "ini.h"
|
||||
|
||||
#define DEFAULT_CONFIG_PATH "/etc/chimer95.conf"
|
||||
#define buffer_maxlength 2048
|
||||
#define buffer_tlength_fragsize 2048
|
||||
#define buffer_prebuf 0
|
||||
|
||||
#include "../dsp/oscillator.h"
|
||||
#include "oscillator.h"
|
||||
|
||||
#define DEFAULT_FREQ 1000.0f
|
||||
#define DEFAULT_SAMPLE_RATE 8000
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
#define BUFFER_SIZE 1024
|
||||
|
||||
#include "../io/audio.h"
|
||||
#include "audio.h"
|
||||
|
||||
#define DEFAULT_MASTER_VOLUME 0.5f
|
||||
#define DEFAULT_OFFSET 0
|
||||
|
||||
+8
-8
@@ -1,6 +1,6 @@
|
||||
#include <getopt.h>
|
||||
#include <liquid/liquid.h>
|
||||
#include "../inih/ini.h"
|
||||
#include "ini.h"
|
||||
#include <stdbool.h>
|
||||
|
||||
#define DEFAULT_INI_PATH "/etc/fm95/fm95.conf"
|
||||
@@ -8,16 +8,16 @@
|
||||
#define buffer_maxlength 99960
|
||||
#define buffer_tlength_fragsize 99960
|
||||
|
||||
#include "../dsp/oscillator.h"
|
||||
#include "../filter/iir.h"
|
||||
#include "../modulation/stereo_encoder.h"
|
||||
#include "../filter/bs412.h"
|
||||
#include "../filter/gain_control.h"
|
||||
#include "oscillator.h"
|
||||
#include "iir.h"
|
||||
#include "stereo_encoder.h"
|
||||
#include "bs412.h"
|
||||
#include "gain_control.h"
|
||||
|
||||
#define BUFFER_SIZE 4998 // This defines how many samples to process at a time, because the loop here is this: get signal -> process signal -> output signal, and when we get signal we actually get BUFFER_SIZE of them
|
||||
|
||||
#include "../io/audio.h"
|
||||
#include "../io/ipc.h"
|
||||
#include "audio.h"
|
||||
#include "ipc.h"
|
||||
|
||||
static volatile sig_atomic_t to_run = 1;
|
||||
static volatile sig_atomic_t to_reload = 0;
|
||||
|
||||
+23
-2
@@ -9,7 +9,7 @@
|
||||
#define DEFAULT_DEVIATION 7000.0f
|
||||
#define DEFAULT_CLIPPER_THRESHOLD 1.0f
|
||||
|
||||
#include "../modulation/fm_modulator.h"
|
||||
#include "oscillator.h"
|
||||
|
||||
#define DEFAULT_SAMPLE_RATE 192000
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
#define BUFFER_SIZE 2048
|
||||
|
||||
#include "../io/audio.h"
|
||||
#include "audio.h"
|
||||
|
||||
#define DEFAULT_AUDIO_VOLUME 1.0f // Audio volume, before clipper
|
||||
|
||||
@@ -70,6 +70,27 @@ void show_help(char *name) {
|
||||
);
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
float frequency;
|
||||
float deviation;
|
||||
float osc_phase;
|
||||
float sample_rate;
|
||||
} FMModulator;
|
||||
|
||||
void init_fm_modulator(FMModulator *fm, float frequency, float deviation, float sample_rate) {
|
||||
fm->frequency = frequency;
|
||||
fm->deviation = deviation;
|
||||
fm->sample_rate = sample_rate;
|
||||
fm->osc_phase = 0.0f;
|
||||
}
|
||||
|
||||
float modulate_fm(FMModulator *fm, float sample) {
|
||||
float inst_freq = fm->frequency+(sample*fm->deviation);
|
||||
fm->osc_phase += (M_2PI * inst_freq) / fm->sample_rate;
|
||||
fm->osc_phase -= (fm->osc_phase >= M_2PI) ? M_2PI : 0.0f;
|
||||
return sinf(fm->osc_phase);
|
||||
}
|
||||
|
||||
int run_sca95(const Sca95_Config config, Sca95_Runtime* runtime) {
|
||||
FMModulator sca_mod;
|
||||
init_fm_modulator(&sca_mod, config.freq, config.deviation, config.sample_rate);
|
||||
|
||||
+3
-3
@@ -10,9 +10,9 @@
|
||||
#define buffer_tlength_fragsize 12288
|
||||
#define buffer_prebuf 64
|
||||
|
||||
#include "../io/audio.h"
|
||||
#include "../lib/debug.h"
|
||||
#include "../lib/vban.h"
|
||||
#include "audio.h"
|
||||
#include "debug.h"
|
||||
#include "vban.h"
|
||||
|
||||
#define BUF_SIZE 1500
|
||||
#define MAX_AUDIO_DATA_SIZE (BUF_SIZE - sizeof(VBANHeader))
|
||||
|
||||
Reference in New Issue
Block a user