Slightly improve AudioBufferSourceNode resampling. Use simple linear extrapolation to resample the data when we reach the end of the buffer. Previously, the last sample would just be repeated enough times.
Created attachment 409423 [details] Patch
Created attachment 409424 [details] Patch
Comment on attachment 409424 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=409424&action=review > Source/WebCore/Modules/webaudio/AudioBufferSourceNode.cpp:416 > + float sample; > + if (readIndex == readIndex2 && readIndex >= 1) { > + // We're at the end of the buffer, so just linearly extrapolate from the last two samples. > + float sample1 = source[readIndex - 1]; > + float sample2 = source[readIndex]; > + sample = sample2 + (sample2 - sample1) * interpolationFactor; > + } else { > + float sample1 = source[readIndex]; > + float sample2 = source[readIndex2]; > + sample = sample1 + interpolationFactor * (sample2 - sample1); > + } > > - destination[writeIndex] = narrowPrecisionToFloat(sample); > + destination[writeIndex] = sample; It looks like this is an identical copy of the code above. Can it be moved to a shared function?
Created attachment 409428 [details] Patch
Created attachment 409432 [details] Patch
Committed r267453: <https://trac.webkit.org/changeset/267453> All reviewed patches have been landed. Closing bug and clearing flags on attachment 409432 [details].
<rdar://problem/69406153>