Reduce teleport start audio gain

This commit is contained in:
Jage9
2026-02-22 20:26:59 -05:00
parent 54cfffc5cf
commit 6f50169805
2 changed files with 5 additions and 3 deletions

View File

@@ -1,5 +1,5 @@
// Maintainer-controlled web client version. // Maintainer-controlled web client version.
// Format: YYYY.MM.DD Rn (example: 2026.02.20 R2) // Format: YYYY.MM.DD Rn (example: 2026.02.20 R2)
window.CHGRID_WEB_VERSION = "2026.02.22 R183"; window.CHGRID_WEB_VERSION = "2026.02.22 R184";
// Optional display timezone for timestamps. Falls back to America/Detroit if unset/invalid. // Optional display timezone for timestamps. Falls back to America/Detroit if unset/invalid.
window.CHGRID_TIME_ZONE = "America/Detroit"; window.CHGRID_TIME_ZONE = "America/Detroit";

View File

@@ -178,6 +178,7 @@ const SYSTEM_SOUND_URLS = {
const FOOTSTEP_SOUND_URLS = Array.from({ length: 11 }, (_, index) => withBase(`sounds/step-${index + 1}.ogg`)); const FOOTSTEP_SOUND_URLS = Array.from({ length: 11 }, (_, index) => withBase(`sounds/step-${index + 1}.ogg`));
const FOOTSTEP_GAIN = 0.7; const FOOTSTEP_GAIN = 0.7;
const TELEPORT_START_SOUND_URL = withBase('sounds/teleport_start.ogg'); const TELEPORT_START_SOUND_URL = withBase('sounds/teleport_start.ogg');
const TELEPORT_START_GAIN = 0.1;
const TELEPORT_SOUND_URL = withBase('sounds/teleport.ogg'); const TELEPORT_SOUND_URL = withBase('sounds/teleport.ogg');
const WALL_SOUND_URL = withBase('sounds/wall.ogg'); const WALL_SOUND_URL = withBase('sounds/wall.ogg');
@@ -1128,7 +1129,7 @@ function startTeleportTo(targetX: number, targetY: number, completionStatus: str
stopTeleportLoopAudio(); stopTeleportLoopAudio();
activeTeleportLoopToken += 1; activeTeleportLoopToken += 1;
const loopToken = activeTeleportLoopToken; const loopToken = activeTeleportLoopToken;
void audio.startLoopingSample(TELEPORT_START_SOUND_URL, FOOTSTEP_GAIN).then((stopLoop) => { void audio.startLoopingSample(TELEPORT_START_SOUND_URL, TELEPORT_START_GAIN).then((stopLoop) => {
if (!stopLoop) return; if (!stopLoop) return;
if (activeTeleport && loopToken === activeTeleportLoopToken) { if (activeTeleport && loopToken === activeTeleportLoopToken) {
activeTeleportLoopStop = stopLoop; activeTeleportLoopStop = stopLoop;
@@ -1443,10 +1444,11 @@ const onAppMessage = createOnMessageHandler({
sanitizeName, sanitizeName,
randomFootstepUrl, randomFootstepUrl,
playRemoteSpatialStepOrTeleport: (url, peerX, peerY) => { playRemoteSpatialStepOrTeleport: (url, peerX, peerY) => {
const gain = url === TELEPORT_START_SOUND_URL ? TELEPORT_START_GAIN : FOOTSTEP_GAIN;
void audio.playSpatialSample( void audio.playSpatialSample(
url, url,
{ x: peerX - state.player.x, y: peerY - state.player.y }, { x: peerX - state.player.x, y: peerY - state.player.y },
FOOTSTEP_GAIN, gain,
); );
}, },
TELEPORT_SOUND_URL, TELEPORT_SOUND_URL,