diff --git a/js/main.js b/js/main.js index 90fd8e0..3acf50d 100644 --- a/js/main.js +++ b/js/main.js @@ -1,6 +1,6 @@ // ---------- Глобальные переменные и инициализация ---------- const GROQ_API_KEY = ''; -const VERSION = 'v80'; +const VERSION = 'v81'; 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 3ffbfe3..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с в начале (щелчок) — декодируем → WAV - const trimmedBlob = await trimStartBlob(blob); - const form = new FormData(); - form.append('file', trimmedBlob, 'audio.wav'); + form.append('file', blob, 'audio.webm'); form.append('model', 'whisper-large-v3'); form.append('language', 'it'); - console.log('[HTTP] blob ' + (trimmedBlob.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', {