Reputation: 153
Reluctantly, I am asking you guys here to help me overcome my brain freeze. I am recording audio but I have a problem with not being able to get the recorded audio without half of it missing.
recAudioInput = recAudioContext.createMediaStreamSource(stream);
recorder= recAudioContext.createScriptProcessor(theBufferSize, 2, 2); // (or 1,1, no difference)
recAudioInput.connect(recorder);
recorder.connect(recAudioContext.destination);
Recording for let's say 5 seconds and speaking 1 2 3 4 5 gives me about 200K of data containing 1 2 3 ... I will have to wait (and continue to record) the same amount of time (in this case 5 seconds) to get the rest. Quite frankly, that doesn't seem right.
But I don't see the error. Shouldn't the inputbuffer return a total of about 400K of data per channel (44.1 * (16/8) * 5) after 5 seconds?
Thanks for your help.
Michaela
Upvotes: 0
Views: 366
Reputation: 153
I am sorry. It was my own stupid mistake. I made a miscalculation of the expected wav file length which in turn lead to a shortened wav file missing a few seconds.
Upvotes: 1