v40: remove debug logs, clean CORS (only Flask handles it)
This commit is contained in:
+3
-5
@@ -53,7 +53,7 @@ let mediaRecorder, audioChunks = [], userAudioBlob = null, ttsText = '';
|
||||
let isRecording = false, isAnalyzing = false, micAnalyser = null, micAnimId = null;
|
||||
let recordStartTime = 0, recordDuration = 0;
|
||||
// ---------- Версия ----------
|
||||
const VERSION = 'v39';
|
||||
const VERSION = 'v40';
|
||||
document.getElementById('ver').textContent = VERSION;
|
||||
|
||||
// ---------- Перевод на русский (Groq) ----------
|
||||
@@ -221,12 +221,11 @@ async function doCompare(blob, originalText, duration) {
|
||||
const elapsed = ((Date.now() - startTime) / 1000).toFixed(1);
|
||||
setStatus('Анализ... ' + elapsed + 'с');
|
||||
}, 150);
|
||||
const t0 = performance.now();
|
||||
let whisperResult, phon;
|
||||
try {
|
||||
[whisperResult, phon] = await Promise.all([
|
||||
transcribe(blob).then(r => { console.log('[TIMING] transcribe:', ((performance.now()-t0)/1000).toFixed(2)+'s'); return r; }),
|
||||
phoneticAnalysis(blob).then(r => { console.log('[TIMING] phonetic:', ((performance.now()-t0)/1000).toFixed(2)+'s'); return r; })
|
||||
transcribe(blob),
|
||||
phoneticAnalysis(blob)
|
||||
]);
|
||||
} catch(e) {
|
||||
clearInterval(timerId);
|
||||
@@ -611,7 +610,6 @@ document.getElementById('btnPlayUser').onclick = async () => {
|
||||
|
||||
async function transcribe(blob) {
|
||||
if (!GROQ_API_KEY) return { text: '', error: 'no_key' };
|
||||
console.log('[BLOB] size:', blob.size, 'bytes, type:', blob.type);
|
||||
const formData = new FormData();
|
||||
formData.append('file', new File([blob], 'audio.webm', { type: 'audio/webm' }));
|
||||
formData.append('model', 'whisper-large-v3');
|
||||
|
||||
Reference in New Issue
Block a user