diff --git a/src/audioWorklet/ringBuffer.js b/src/audioWorklet/ringBuffer.js index 80dc06e9..cb5925ff 100644 --- a/src/audioWorklet/ringBuffer.js +++ b/src/audioWorklet/ringBuffer.js @@ -63,7 +63,7 @@ class RingBuffer { // match with this buffer obejct. // Transfer data from the |arraySequence| storage to the internal buffer. - let sourceLength = arraySequence[0].length; + let sourceLength = arraySequence[0] ? arraySequence[0].length : 0; for (let i = 0; i < sourceLength; ++i) { let writeIndex = (this._writeIndex + i) % this._length; for (let channel = 0; channel < this._channelCount; ++channel) {