From 4acc400fabf96117ed0e50ad4f27b1df3e4d1554 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CNaeel=E2=80=9D?= Date: Sat, 23 May 2026 07:16:10 +0400 Subject: [PATCH] =?UTF-8?q?v88:=20async=20onopen=20+=2010ms=20=D0=B7=D0=B0?= =?UTF-8?q?=D0=B4=D0=B5=D1=80=D0=B6=D0=BA=D0=B0=20=D0=BC=D0=B5=D0=B6=D0=B4?= =?UTF-8?q?=D1=83=20=D1=87=D0=B0=D0=BD=D0=BA=D0=B0=D0=BC=D0=B8=20=E2=80=94?= =?UTF-8?q?=20=D0=B1=D1=83=D1=84=D0=B5=D1=80=20Chrome?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dist/index.html | 6 ++++-- js/main.js | 2 +- js/transcribe.js | 4 +++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/dist/index.html b/dist/index.html index 8174a89..67f3484 100644 --- a/dist/index.html +++ b/dist/index.html @@ -276,7 +276,7 @@ async function transcribe(blob) { console.log('[WS] timeout'); ws.close(); resolve({ text: '', error: 'timeout' }); }, 60000); - ws.onopen = () => { + ws.onopen = async () => { console.log('[WS] connected, sending ' + total + ' chunks'); for (let i = 0; i < base64.length; i += CHUNK) { ws.send(JSON.stringify({ @@ -286,6 +286,8 @@ async function transcribe(blob) { m: mime, n: total })); + // Даём браузеру протолкнуть буфер — Chrome может терять фреймы без этого + await new Promise(r => setTimeout(r, 10)); } ws.send(JSON.stringify({ c: -1 })); console.log('[WS] all sent'); @@ -803,7 +805,7 @@ async function doCompare(blob, originalText, duration) {