From aed4dd0fce0900011633bde710bbd83f01ff1a9f Mon Sep 17 00:00:00 2001 From: EJClaw Date: Wed, 14 Oct 2026 09:58:24 +0900 Subject: [PATCH] =?UTF-8?q?=EC=B1=84=ED=8C=85=20=EC=86=8C=EB=A6=AC?= =?UTF-8?q?=EB=A5=BC=20=EB=A9=94=EC=8B=A0=EC=A0=80=20=EA=B0=99=EC=9D=80=20?= =?UTF-8?q?"=EB=BD=80=EB=A1=9D"=EC=9C=BC=EB=A1=9C:=20=EB=91=90=20=EC=9D=8C?= =?UTF-8?q?=EC=9D=B4=20=EC=98=AC=EB=9D=BC=EA=B0=80=EB=8A=94=20"=EB=9D=A0?= =?UTF-8?q?=EB=A6=AD"=EC=9D=80=20=EB=A7=9E=EC=9D=8C=C2=B7=EB=82=B4=20?= =?UTF-8?q?=EC=B0=A8=EB=A1=80=20=EA=B0=99=EC=9D=80=20=EC=84=A4=EC=A0=95/?= =?UTF-8?q?=EA=B2=8C=EC=9E=84=20=EC=86=8C=EB=A6=AC=EC=99=80=20=ED=97=B7?= =?UTF-8?q?=EA=B0=88=EB=A0=A4=EC=84=9C,=20=EB=82=AE=EC=9D=80=20=EB=8D=B0?= =?UTF-8?q?=EC=84=9C=20=EB=B9=A0=EB=A5=B4=EA=B2=8C=20=EB=AF=B8=EB=81=84?= =?UTF-8?q?=EB=9F=AC=EC=A0=B8=20=EC=98=A4=EB=A5=B4=EB=8A=94=20=EB=AC=BC?= =?UTF-8?q?=EB=B0=A9=EC=9A=B8=20=EB=91=90=20=EA=B0=9C(380=E2=86=921150Hz,?= =?UTF-8?q?=20520=E2=86=921500Hz)=EB=A1=9C=20=EB=B0=94=EA=BF=88.=20?= =?UTF-8?q?=ED=81=AC=EA=B8=B0(=EA=B2=8C=EC=9E=84=20=EC=86=8C=EB=A6=AC?= =?UTF-8?q?=EC=9D=98=2090%)=C2=B7=EC=86=8C=EB=A6=AC=20=ED=81=AC=EA=B8=B0?= =?UTF-8?q?=20=EC=84=A4=EC=A0=95=C2=B7=EB=AA=B0=EB=A6=BC=20=ED=95=9C=20?= =?UTF-8?q?=EB=B2=88=C2=B7=EC=A7=80=EB=82=9C=20=EC=B1=84=ED=8C=85=20?= =?UTF-8?q?=EC=A1=B0=EC=9A=A9=ED=9E=88=EB=8A=94=20=EA=B7=B8=EB=8C=80?= =?UTF-8?q?=EB=A1=9C.=20feedback.test.ts=EC=99=80=20chat.e2e.ts=EC=9D=98?= =?UTF-8?q?=20=EC=9D=8C=20=ED=99=95=EC=9D=B8=EB=8F=84=20=EB=A7=9E=EC=B6=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 --- apps/web/src/lib/feedback.test.ts | 11 ++++++----- apps/web/src/lib/feedback.ts | 13 +++++-------- e2e/chat.e2e.ts | 6 +++--- 3 files changed, 14 insertions(+), 16 deletions(-) diff --git a/apps/web/src/lib/feedback.test.ts b/apps/web/src/lib/feedback.test.ts index 1c983f3..5daec48 100644 --- a/apps/web/src/lib/feedback.test.ts +++ b/apps/web/src/lib/feedback.test.ts @@ -1,8 +1,9 @@ import { beforeEach, expect, mock, test } from 'bun:test'; -/** A fake Web Audio graph that records every oscillator note: frequency, start and peak level. */ +/** A fake Web Audio graph that records every oscillator note: frequency (and where it glides to), start and peak level. */ interface Note { freq: number; + to: number; start: number; peak: number; } @@ -45,7 +46,7 @@ class FakeCtx { return { connect: () => {} }; }, start(t: number) { - notes.push({ freq: frequency.value, start: t, peak: g!.gain.peak }); + notes.push({ freq: frequency.value, to: frequency.peak, start: t, peak: g!.gain.peak }); }, stop() {}, }; @@ -79,9 +80,9 @@ test('chat sound is 10% under the game sounds', () => { for (const n of notes) byStart.set(n.start, (byStart.get(n.start) ?? 0) + n.peak); const loudest = Math.max(...byStart.values()); expect(loudest).toBeCloseTo(game * 0.9, 6); - // Two rising notes ("띠릭"). - const mains = [...new Set(notes.map((n) => n.start))].sort().map((t) => Math.min(...notes.filter((n) => n.start === t).map((n) => n.freq))); - expect(mains).toEqual([1568, 2093]); + // Two bubbles ("뽀록"), each gliding up from a low start. + expect(notes.map((n) => n.freq)).toEqual([380, 520]); + expect(notes.map((n) => n.to)).toEqual([1150, 1500]); }); test('chat sound follows the volume setting and is silent when sound is off', async () => { diff --git a/apps/web/src/lib/feedback.ts b/apps/web/src/lib/feedback.ts index 0d77885..0e0b04b 100644 --- a/apps/web/src/lib/feedback.ts +++ b/apps/web/src/lib/feedback.ts @@ -195,19 +195,16 @@ export const CHAT_LEVEL = GAME_LEVEL * 0.9; let lastChatAt = -Infinity; /** - * StarCraft-like chat "띠릭": two quick, glassy notes going up (sine + a soft octave on top), about 0.2 s. - * The layers of a note add up to CHAT_LEVEL at most. Lines arriving in a burst share one sound. + * Chat "뽀록": two water-drop bubbles like a messenger, each a sine gliding up fast (about 0.15 s in all). + * Kept apart from the UI/game sounds, which are steady notes (click, good, myTurn …), so it is not mistaken for one. + * The louder bubble peaks at CHAT_LEVEL. Lines arriving in a burst share one sound. */ export function chatSound(): void { const now = performance.now(); if (now - lastChatAt < 80) return; lastChatAt = now; - const main = CHAT_LEVEL * 0.8; - const air = CHAT_LEVEL * 0.2; - tone(1568, 70, 'sine', main, 0, { attack: 3, slideTo: 1661 }); - tone(3136, 50, 'sine', air, 0, { attack: 3 }); - tone(2093, 140, 'sine', main, 65, { attack: 3 }); - tone(4186, 90, 'sine', air, 65, { attack: 3 }); + tone(380, 70, 'sine', CHAT_LEVEL, 0, { attack: 2, slideTo: 1150 }); + tone(520, 80, 'sine', CHAT_LEVEL * 0.7, 75, { attack: 2, slideTo: 1500 }); } /** Plays the chat sound whenever `lastKey` (the newest live chat line) changes after the first render. */ diff --git a/e2e/chat.e2e.ts b/e2e/chat.e2e.ts index 2f08a63..7ae7920 100644 --- a/e2e/chat.e2e.ts +++ b/e2e/chat.e2e.ts @@ -242,14 +242,14 @@ try { if (await a.locator('.room-bar').getByRole('button', { name: /^채팅/ }).count()) throw new Error('chat button still on the wide bar'); }); - await step('채팅 소리: 새 줄마다 "띠릭"(보낸 사람도), 다시 들어올 때 받는 지난 줄은 조용히', async () => { - // Count the chat sound's first note (1568 Hz) as it is scheduled. + await step('채팅 소리: 새 줄마다 "뽀록"(보낸 사람도), 다시 들어올 때 받는 지난 줄은 조용히', async () => { + // Count the chat sound's first bubble (starts at 380 Hz) as it is scheduled. const rec = () => { const w = window as unknown as { __chatBeeps: number }; w.__chatBeeps = 0; const orig = AudioParam.prototype.setValueAtTime; AudioParam.prototype.setValueAtTime = function (v: number, t: number) { - if (v === 1568) w.__chatBeeps++; + if (v === 380) w.__chatBeeps++; return orig.call(this, v, t); }; };