That’s generally correct. You don’t need the AudioProcessor:: part as your processor will be inherited from AudioProcessor.
It’s best practice to call setLatencySamples() from the constructor or prepareToPlay(). Calling it after the plugin has been initialized (e.g prepareToPlay()) makes some DAWs sad and can result in unexpected behavior or even crashes.
Excellent, many thanks for that,
do i have to define the number of samples ?
eg. setLatencySamples(225) ?
is there any example project?
apologies for my ignorance
You just need to make the setLatency call in a suitable place in your code (the constructor or prepareToPlay), you should not add a new function named setLatency.
I am geting the number from Smaart
I take as a reference a track without the plugin and I measure it against the track with the plugin and I get 5.12 ms
then i do 44100*0.00512 = 225.792 to convert ms to samples
so it is 225.792 I want to use and not 226.015 I wrote earlier but still is the same problem with the floating point number…
should I just ignore the . part and round up to 226 ?
is this the way to go about it anyway?
Set your DAW to Samples and bounce to a new track with different presets and check the difference between the source and destination… and that will give you your latency in samples. Some algorithms have variable latency – so you need to check if yours is constant or not.