Audio Data Corrupted From onaudioprocess?

33 views
Skip to first unread message

Josh Dickson

unread,
Jun 23, 2016, 4:44:07 PM6/23/16
to discuss-webrtc
Hi,

This is a sample of audio from a recording that was taken with Chrome 51 using a script processing node (it's only about 4s). Occasionally we'll be midway through a recording and this will start occurring. It does not fix itself and continues to happen across a number of WAVs until we're finished with the call.


The audio is entirely messed up/choppy/etc. This is what we get from packets received by onaudioprocess (that is, I am fairly sure it's not something getting corrupted later on in our processing), as this WAV originated from the client side of things. 

During the call, there is no evidence that anything is wrong - the audio sounds fine sent to other people. But obviously something is extremely wrong when listening to the WAV file.

Any clues? Thanks,

Josh

Chris Ward

unread,
Jun 28, 2016, 5:10:11 PM6/28/16
to discuss-webrtc
I've noticed that the update rate of the scriptProcessorNode is not constant.  I'd expect this to update at rate of audioCtx.sampleRate / bufferSize and at a constant rate.  But that just is not the case.  Especially if you do heavy processing, the sample rate can be slowed.  I've also noticed the scriptprocessor will at times update much more frequently than the expected rate.  At times I even saw the onaudioprocess event trigger multiple times with same input time.  All in this leads to a lot of output jitter.  

This will only affect output from the scriptProcessorNode.  Parts of your audio network not connected to this output are not affected.

- Chris
Reply all
Reply to author
Forward
0 new messages