From 689fa78734f49db06566965f76507acb53162103 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CNaeel=E2=80=9D?= Date: Sat, 23 May 2026 05:57:46 +0400 Subject: [PATCH] =?UTF-8?q?v79:=20=D1=83=D0=B1=D1=80=D0=B0=D0=BD=20phoneti?= =?UTF-8?q?cAnalysis=20=E2=80=94=20=D1=82=D0=BE=D0=BB=D1=8C=D0=BA=D0=BE=20?= =?UTF-8?q?Whisper=20+=20=D1=81=D0=BB=D0=BE=D0=B3=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dist/index.html | 27 +++++++-------------------- js/compare.js | 25 ++++++------------------- js/main.js | 2 +- 3 files changed, 14 insertions(+), 40 deletions(-) diff --git a/dist/index.html b/dist/index.html index 5f8aab8..3ad13c6 100644 --- a/dist/index.html +++ b/dist/index.html @@ -666,15 +666,9 @@ async function doCompare(blob, originalText, duration) { const elapsed = ((Date.now() - startTime) / 1000).toFixed(1); setStatus('Анализ... ' + elapsed + 'с'); }, 150); - let whisperResult, phon; + let whisperResult; try { - const phonTimeout = new Promise(resolve => - setTimeout(() => resolve({ pitchHz: 0, pitchStability: 0, voiceClarity: 0, phonScore: 0 }), 15000) - ); - [whisperResult, phon] = await Promise.all([ - transcribe(blob), - Promise.race([phoneticAnalysis(blob), phonTimeout]) - ]); + whisperResult = await transcribe(blob); } catch(e) { clearInterval(timerId); isAnalyzing = false; @@ -683,33 +677,26 @@ async function doCompare(blob, originalText, duration) { } clearInterval(timerId); - const phonEmoji = phon.phonScore >= 85 ? '🟢' : phon.phonScore >= 60 ? '🟡' : '🔴'; let recHTML = '', diffHTML = ''; if (whisperResult.text) { const _transcribed = whisperResult.text; const { score, words } = compareTexts(originalText, whisperResult.text); const recEmoji = score >= 90 ? '🟢' : score >= 70 ? '🟡' : '🔴'; - recHTML = recEmoji + ' Распознание: ' + score + '%  |  🗣 ' + whisperResult.text + '  |  '; + recHTML = recEmoji + ' Распознание: ' + score + '%  |  🗣 ' + whisperResult.text + ''; diffHTML = '
' + '📋 Текст: зелёный ≥80%, жёлтый ≥50%, красный <50%' + '
' + renderDiff(words); } else { - recHTML = ''; + recHTML = '⚠️ Не распознано'; diffHTML = ''; } - document.getElementById('score').innerHTML = - recHTML + phonEmoji + ' Произношение: ' + phon.phonScore + '%'; + document.getElementById('score').innerHTML = recHTML; - document.getElementById('diff').innerHTML = diffHTML + - '
' + - '🎵 Тон: ' + phon.pitchHz + ' Hz' + - '📏 Стабильность: ' + phon.pitchStability + '%' + - '🗣 Артикуляция: ' + phon.voiceClarity + '%' + - '
'; + document.getElementById('diff').innerHTML = diffHTML; // Слоги — в отдельный div, не в diff (diff перезаписывается) _currentBlob = blob; @@ -748,7 +735,7 @@ async function doCompare(blob, originalText, duration) {