Spaces:
Sleeping
Sleeping
Commit ·
8255e28
1
Parent(s): eb3d745
updated
Browse files760 unmodified lines7617627637647657664 unmodified lines771772773774775776777778760 unmodified lines// Create blob from audio chunksconst audioBlob = new Blob(this.audioChunks, { type: 'audio/webm' });formData.append('audio', audioBlob, 'recording.webm');console.log('Created audio blob:', audioBlob.size, 'bytes');4 unmodified linesreturn;}const formData = new FormData();formData.append('audio', audioBlob, 'recording.webm');console.log('Sending audio for transcription...');const response = await fetch('/api/transcribe_audio', {760 unmodified lines7617627637647657667677687697707717724 unmodified lines777778779780781782783784760 unmodified lines// Create blob from audio chunksconst audioBlob = new Blob(this.audioChunks, { type: 'audio/webm' });// Initialise a new FormData instance AFTER creating the blob// and append the audio. Previously a call to `formData.append` was// made before the variable was declared, causing a reference// error and triggering the generic "Error processing audio" message.const formData = new FormData();formData.append('audio', audioBlob, 'recording.webm');console.log('Created audio blob:', audioBlob.size, 'bytes');4 unmodified linesreturn;}// formData has already been created and the audio appended above.// Do not recreate or re-append here.console.log('Sending audio for transcription...');const response = await fetch('/api/transcribe_audio', {
backend/templates/interview.html+8-2