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) {