This commit is contained in:
2026-04-28 20:27:09 +02:00
parent 63842c44f4
commit f628fc25b6
+3 -5
View File
@@ -19,8 +19,6 @@ float stereo_encode(StereoEncoder* st, uint8_t enabled, float left, float right,
if(st->stereo_hilbert) mid = delay_line(&st->delay, mid); if(st->stereo_hilbert) mid = delay_line(&st->delay, mid);
float half_audio = st->audio_volume * 0.5f;
float side = (left-right) * 0.5f; float side = (left-right) * 0.5f;
float complex stereo_hilbert = 0+0*I; float complex stereo_hilbert = 0+0*I;
@@ -35,11 +33,11 @@ float stereo_encode(StereoEncoder* st, uint8_t enabled, float left, float right,
} }
float signalx2 = get_oscillator_sin_multiplier_ni(st->osc, st->multiplier * 2.0f); float signalx2 = get_oscillator_sin_multiplier_ni(st->osc, st->multiplier * 2.0f);
*audio = (mid*half_audio); *audio = (mid*st->audio_volume);
if(st->stereo_hilbert) { if(st->stereo_hilbert) {
float stereo = (crealf(stereo_hilbert) * signalx2) - (cimagf(stereo_hilbert) * signalx2cos); float stereo = (crealf(stereo_hilbert) * signalx2) - (cimagf(stereo_hilbert) * signalx2cos);
*audio += (stereo * half_audio); *audio += (stereo * st->audio_volume);
} else *audio += ((side*signalx2) * half_audio); } else *audio += ((side*signalx2) * st->audio_volume);
return (signalx1*st->pilot_volume); return (signalx1*st->pilot_volume);
} }