From a21b7e86a2354966718d7cce40d51b68ac2b3c53 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 --- js/audio.js | 6 +++++- js/main.js | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/js/audio.js b/js/audio.js index 338c5d8..590c77b 100644 --- a/js/audio.js +++ b/js/audio.js @@ -105,7 +105,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; }); } diff --git a/js/main.js b/js/main.js index 7d488e3..7cca8cd 100644 --- a/js/main.js +++ b/js/main.js @@ -1,6 +1,6 @@ // ---------- Глобальные переменные и инициализация ---------- const GROQ_API_KEY = ''; -const VERSION = 'v77'; +const VERSION = 'v78'; let mediaRecorder, audioChunks = [], userAudioBlob = null, ttsText = ''; let isRecording = false, isAnalyzing = false, micAnalyser = null, micAnimId = null;