How to know the recording latency for certain device


#1

Hi, guys
Hope you are doing well!
If we attach some device for recording using juce, how to determine the latency for the recording? That means how to determine the latency in terms of number samples.

Thanks!
Leon


#2

AudioIODevice::getInputLatencyInSamples()


#3

hi, jules
How are you?
is getInputLatencyInSamples() funciton accurate? is it exact latency in samples for same device attached to different computers?

I saw the calculation for the latencyInSamples, it is
inputLatency + currentBlockSizeSamples / 4;

Is it approximation ?

Thanks!
Leon


#4

That depends on the device - if it’s DirectSound, then it’s a wildly inaccurate guess. For ASIO or CoreAudio it’s probably very accurate for most soundcards, but it depends on the driver.