Keep grid panning for mono/left/right radio modes

This commit is contained in:
Jage9
2026-02-21 01:56:42 -05:00
parent 5cd4dce103
commit 5a3f3d3044
2 changed files with 2 additions and 6 deletions

View File

@@ -1,3 +1,3 @@
// Maintainer-controlled web client version.
// Format: YYYY.MM.DD Rn (example: 2026.02.20 R2)
window.CHGRID_WEB_VERSION = "2026.02.21 R79";
window.CHGRID_WEB_VERSION = "2026.02.21 R80";

View File

@@ -685,7 +685,6 @@ function updateRadioStationSpatialAudio(): void {
const normalizedVolume = Number.isFinite(volume) ? Math.max(0, Math.min(100, volume)) / 100 : 0.5;
const effect = normalizeRadioEffect(item.params.effect);
const effectValue = normalizeRadioEffectValue(item.params.effectValue);
const channel = normalizeRadioChannel(item.params.channel);
applyRadioEffect(output, audioCtx, effect, effectValue);
if (!streamUrl || !enabled) {
output.gain.gain.linearRampToValueAtTime(0, audioCtx.currentTime + 0.05);
@@ -704,10 +703,7 @@ function updateRadioStationSpatialAudio(): void {
}
output.gain.gain.linearRampToValueAtTime(gainValue * normalizedVolume, audioCtx.currentTime + 0.1);
if (output.panner) {
let resolvedPan = Math.max(-1, Math.min(1, panValue));
if (channel !== 'stereo') {
resolvedPan = 0;
}
const resolvedPan = Math.max(-1, Math.min(1, panValue));
output.panner.pan.linearRampToValueAtTime(resolvedPan, audioCtx.currentTime + 0.1);
}
}