diff --git a/js/main.js b/js/main.js index db09a4e..9beeaa0 100644 --- a/js/main.js +++ b/js/main.js @@ -1,6 +1,6 @@ // ---------- Глобальные переменные и инициализация ---------- const GROQ_API_KEY = ''; -const VERSION = 'v82'; +const VERSION = 'v83'; let mediaRecorder, audioChunks = [], userAudioBlob = null, ttsText = ''; let isRecording = false, isAnalyzing = false, micAnalyser = null, micAnimId = null; diff --git a/js/transcribe.js b/js/transcribe.js index 3adcdb1..f5313db 100644 --- a/js/transcribe.js +++ b/js/transcribe.js @@ -4,15 +4,12 @@ async function transcribe(blob) { if (!GROQ_API_KEY) return { text: '', error: 'no_key' }; const tStart = performance.now(); - // Обрезаем 0.2с в начале (щелчок) - const sendBlob = await trimStartBlob(blob); - const form = new FormData(); - form.append('file', sendBlob, sendBlob.type === 'audio/wav' ? 'audio.wav' : 'audio.webm'); + form.append('file', blob, 'audio.webm'); form.append('model', 'whisper-large-v3'); form.append('language', 'it'); - console.log('[HTTP] blob ' + (sendBlob.size/1024).toFixed(1) + 'KB → multipart POST'); + console.log('[HTTP] blob ' + (blob.size/1024).toFixed(1) + 'KB → multipart POST'); try { const r = await fetch('https://lang.kube5s.ru/openai/v1/audio/transcriptions', {