Open jasonlo87 opened 6 years ago
captureMicrophone(function(microphone) { recorder = RecordRTC(microphone, { type: 'audio', recorderType: StereoAudioRecorder, desiredSampRate: 16000, // bits-per-sample * 1000 numberOfAudioChannels : 1, mimeType: 'audio/wav', sampleBits: 16, disableLogs: true }); recorder.startRecording(); // release microphone on stopRecording recorder.microphone = microphone; });
wavfile -> Unexpected end of file
I tried. really should be 36 This should be a bug. view.setUint32(4, 44 + interleavedLength 2, true); ->view.setUint32(4, 36 + interleavedLength 2, true);
Hi guys! Any takers on this? I am experiencing issues with Wav-files with header issues. Am trying to process the wav-file with SOX noise reduction, but to no avail due to the RIFF header issue from having recorded using recordRTC...
In mergeLeftRightBuffers():
// create wav file var resultingBufferLength = 44 + interleavedLength * 2; var buffer = new ArrayBuffer(resultingBufferLength); var view = new DataView(buffer);
// RIFF chunk descriptor/identifier writeUTFBytes(view, 0, 'RIFF');
// RIFF chunk length
!!! should not be 44, should be 36. The length of the RIFF chunk doesn't include the RIFF label or the 4 size bytes... !!! view.setUint32(4, 44 + interleavedLength * 2, true);