media
media copied to clipboard
AudioBufferSourceNode: Consider using a better interpolation algorithm
We use linear interpolation, as does Blink. Firefox uses libspeex for resampling, which has rust bindings. See https://github.com/servo/media/blob/86b9a2892af3774e42243ac84394a052719b2bf6/audio/buffer_source_node.rs#L390
This interacts interestingly with looping, because samples outside the loop window can (and should!) affect the resampled result inside the loop window. Also, the fact that the loop size need not be a multiple of the offset per tick complicates perfect resampling even further. There are a bunch of tradeoffs to be made here.