Dealing With Oversampler Latency

Hey All,

I’m trying out the new JUCE oversampling classes.

As far as I can tell, it’s working and has improved the sound of my wave shaper under extreme circumstances, but I haven’t really done anything with the getLatencyInSamples()

I’m basically curious, if the latency is reported as 32 samples, what exactly does that mean. Are the first 32 samples of the buffer empty? What is the expected way for me to account for this.

I haven’t used the oversampling features of Juce. But according to this
The latency is caused by the FIR filter which, in your case, must be 64 samples long. You should report the latency to the DAW using the given function in the processor.
Personally I would use the Polyphase IIR option which would greatly minimise the delay.

I’m a bit confused how this actually works in the audio line though, I imagine if there was some sort of delay on the output of the down sampling I’d need to be handling a circular buffer of some kind to keep everything aligned? Or is the oversampling class handling that internally? I.e, the first down sampled buffer has that latency introduced and the any future processing is just delayed by that amount, and the delay is being managed internally?

Thank you for that heads up though! I’ll test the other filter options and see how they effect latency.

  • J

If you think about it as a few samples delay in the resampler when you run audio through it, if you then wanted to (for example) mix that audio back into the dry signal you’d need to delay your dry signal by the same amount.

Reporting audio latency to the DAW enables it to move other tracks backward by that amount, so to the user everything is synchronised correctly - just an overall imperceptible delay between pressing play and hearing a sound. Try Google searching “audio latency”.

Unless you’re building a Host, then you should just worry about reporting back the correct value, rather than adjusting anything yourself.

Like jimc just said, getting the delay value is useful for any internal mixing you may want to do in you own plug-in.