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-01-02 19:14:39 +01:00
parent 47e42f60e0
commit 2b5c979fc5
2 changed files with 9 additions and 9 deletions

View File

@@ -38,5 +38,5 @@ SCAMod is a simple FM modulator which can be used to modulate a secondary audio
Has a fine quality, but as it goes for 12 khz fm signals Has a fine quality, but as it goes for 12 khz fm signals
# SSAPCoder # StereoSCAMod
This "standard" was made by me, it encoder stereo am-quality audio into the FM carrier Stereo SCA, like normal SCA but encodes L-R onto 80 khz

View File

@@ -59,7 +59,7 @@ static void stop(int signum) {
} }
int main() { int main() {
printf("SSCAPMod : Stereo SAP Modulator (based on the SCA encoder SCAMod) made by radio95 (with help of ChatGPT and Claude, thanks!)\n"); printf("StereoSCAMod : Stereo SCA Modulator (based on the SCA encoder SCAMod) made by radio95 (with help of ChatGPT and Claude, thanks!)\n");
// Define formats and buffer atributes // Define formats and buffer atributes
pa_sample_spec mono_audio_format = { pa_sample_spec mono_audio_format = {
@@ -87,7 +87,7 @@ int main() {
pa_simple *input_device = pa_simple_new( pa_simple *input_device = pa_simple_new(
NULL, NULL,
"SSAPMod", "StereoSCAMod",
PA_STREAM_RECORD, PA_STREAM_RECORD,
INPUT_DEVICE, INPUT_DEVICE,
"Audio Input", "Audio Input",
@@ -105,7 +105,7 @@ int main() {
pa_simple *output_device = pa_simple_new( pa_simple *output_device = pa_simple_new(
NULL, NULL,
"SSAPMod", "StereoSCAMod",
PA_STREAM_PLAYBACK, PA_STREAM_PLAYBACK,
OUTPUT_DEVICE, OUTPUT_DEVICE,
"Signal", "Signal",
@@ -121,8 +121,8 @@ int main() {
} }
Oscillator osc_mono, osc_stereo; Oscillator osc_mono, osc_stereo;
init_oscillator(&osc_mono, 68000, SAMPLE_RATE); init_oscillator(&osc_mono, 67000, SAMPLE_RATE);
init_oscillator(&osc_stereo, 77000, SAMPLE_RATE); init_oscillator(&osc_stereo, 80000, SAMPLE_RATE);
#ifdef PREEMPHASIS #ifdef PREEMPHASIS
Emphasis preemp_l, preemp_r; Emphasis preemp_l, preemp_r;
init_emphasis(&preemp_l, PREEMPHASIS_TAU, SAMPLE_RATE); init_emphasis(&preemp_l, PREEMPHASIS_TAU, SAMPLE_RATE);
@@ -181,8 +181,8 @@ int main() {
float mono = (current_left_input+current_right_input)/2.0f; float mono = (current_left_input+current_right_input)/2.0f;
float stereo = (current_left_input-current_right_input)/2.0f; float stereo = (current_left_input-current_right_input)/2.0f;
change_oscillator_frequency(&osc_mono, (68000+(mono*8000))); change_oscillator_frequency(&osc_mono, (67000+(mono*6000)));
change_oscillator_frequency(&osc_stereo, (77000+(stereo*8000))); change_oscillator_frequency(&osc_stereo, (80000+(stereo*6000)));
signal[i] = get_oscillator_sin_sample(&osc_mono)*MONO_VOLUME+ signal[i] = get_oscillator_sin_sample(&osc_mono)*MONO_VOLUME+
get_oscillator_sin_sample(&osc_stereo)*STEREO_VOLUME; get_oscillator_sin_sample(&osc_stereo)*STEREO_VOLUME;
} }