From 80cee77afcf6ca84ed0bafd54ad497e8778bc449 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CNaeel=E2=80=9D?= Date: Fri, 22 May 2026 21:43:00 +0400 Subject: [PATCH] =?UTF-8?q?v78:=20fade-in=2010=D0=BC=D1=81=20=E2=80=94=20?= =?UTF-8?q?=D1=83=D0=B1=D0=B8=D1=80=D0=B0=D0=B5=D1=82=20=D1=89=D0=B5=D0=BB?= =?UTF-8?q?=D1=87=D0=BE=D0=BA=20=D0=BF=D1=80=D0=B8=20=D0=B2=D0=BE=D1=81?= =?UTF-8?q?=D0=BF=D1=80=D0=BE=D0=B8=D0=B7=D0=B2=D0=B5=D0=B4=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dist/index.html | 8 ++++++-- js/audio.js | 6 +++++- js/main.js | 2 +- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/dist/index.html b/dist/index.html index 321454a..5f8aab8 100644 --- a/dist/index.html +++ b/dist/index.html @@ -407,7 +407,11 @@ async function playTrimmed(blob) { } const src = ctx.createBufferSource(); src.buffer = buf; - src.connect(ctx.destination); + const gain = ctx.createGain(); + // Fade-in 10мс — убирает щелчок при старте + gain.gain.setValueAtTime(0, ctx.currentTime); + gain.gain.linearRampToValueAtTime(1, ctx.currentTime + 0.01); + src.connect(gain).connect(ctx.destination); src.start(); return new Promise(resolve => { src.onended = resolve; }); } @@ -744,7 +748,7 @@ async function doCompare(blob, originalText, duration) {