v75: убран автоанализ при проигрывании — ▶ и 🎧 только играют
This commit is contained in:
Vendored
+1
-13
@@ -407,8 +407,6 @@ async function playRec(id) {
|
||||
audio.onerror = () => { URL.revokeObjectURL(url); reject(); };
|
||||
audio.play();
|
||||
});
|
||||
const tr = await doCompare(rec.blob, rec.word, rec.duration);
|
||||
if (tr) saveTranscription(id, tr);
|
||||
}
|
||||
} catch(e) { /* тихо */ }
|
||||
}
|
||||
@@ -735,7 +733,7 @@ async function doCompare(blob, originalText, duration) {
|
||||
<script>
|
||||
// ---------- Глобальные переменные и инициализация ----------
|
||||
const GROQ_API_KEY = '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';
|
||||
const VERSION = 'v74';
|
||||
const VERSION = 'v75';
|
||||
|
||||
let mediaRecorder, audioChunks = [], userAudioBlob = null, ttsText = '';
|
||||
let isRecording = false, isAnalyzing = false, micAnalyser = null, micAnimId = null;
|
||||
@@ -790,10 +788,6 @@ document.getElementById('btnPlayUser').onclick = async () => {
|
||||
setStatus('Ошибка воспроизведения — нажмите ещё раз.');
|
||||
return;
|
||||
}
|
||||
const original = document.getElementById('inputText').value.trim();
|
||||
if (original && userAudioBlob) {
|
||||
await doCompare(userAudioBlob, original, recordDuration);
|
||||
}
|
||||
};
|
||||
|
||||
// ---------- Кнопки ----------
|
||||
@@ -818,10 +812,6 @@ document.getElementById('btnStereo').onclick = async () => {
|
||||
if (!text) return setStatus('Введите текст для эталона!');
|
||||
if (!userAudioBlob) return setStatus('Нет записи! Нажмите 🎙 Записать.');
|
||||
await playStereo(text, userAudioBlob);
|
||||
const original = document.getElementById('inputText').value.trim();
|
||||
if (original && userAudioBlob) {
|
||||
await doCompare(userAudioBlob, original, recordDuration);
|
||||
}
|
||||
};
|
||||
|
||||
// ---------- История: compareRec / stereoRec ----------
|
||||
@@ -848,8 +838,6 @@ async function stereoRec(id) {
|
||||
if (rec?.blob) {
|
||||
document.getElementById('inputText').value = rec.word;
|
||||
await playStereo(rec.word, rec.blob);
|
||||
const tr = await doCompare(rec.blob, rec.word, rec.duration);
|
||||
if (tr) saveTranscription(id, tr);
|
||||
}
|
||||
} catch(e) { setStatus('Ошибка загрузки записи.'); }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user