# AAX setLatencySamples not working

**URL:** <https://forum.juce.com/t/aax-setlatencysamples-not-working/14714>\
**Category:** Audio Plugins\
**Created:** [April 30, 2015, 11:17am UTC](https://forum.juce.com/t/aax-setlatencysamples-not-working/14714 "2015-04-30T11:17:04Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![chkn](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/chkn/32/3862_2.png) [@chkn](https://forum.juce.com/u/chkn)\
**Post date:** [April 30, 2015, 11:17am UTC](https://forum.juce.com/t/aax-setlatencysamples-not-working/14714/1 "2015-04-30T11:17:04Z")

</div>

It seems ProTools just ignoring the latency changes ( even after starting/stopping the transport source)

Checked with ProTools 11 on Mac

---

<div class="post-metadata">

**Author:** ![fr810](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/fr810/32/841_2.png) [@fr810](https://forum.juce.com/u/fr810)\
**Post date:** [April 30, 2015, 12:18pm UTC](https://forum.juce.com/t/aax-setlatencysamples-not-working/14714/2 "2015-04-30T12:18:00Z")

</div>

When are you changing the latency? Looking at juce's AAX wrapper, SetSignalLatency is only called on initialization or when the bufferSize or sampleRate changes (i.e. right after a prepareToPlay call).

---

<div class="post-metadata">

**Author:** ![chkn](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/chkn/32/3862_2.png) [@chkn](https://forum.juce.com/u/chkn)\
**Post date:** [April 30, 2015, 12:41pm UTC](https://forum.juce.com/t/aax-setlatencysamples-not-working/14714/3 "2015-04-30T12:41:55Z")

</div>

AudioProcessor::setLatencySamples allows to change the delay compensation of the Host (if a plugin introduces latency), it triggers the AudioProcessorListener, which is connected to the wrapper, which calls the plugin-format&nbsp;specific method to change the latency.

&nbsp;

---

<div class="post-metadata">

**Author:** ![chkn](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/chkn/32/3862_2.png) [@chkn](https://forum.juce.com/u/chkn)\
**Post date:** [April 30, 2015, 1:21pm UTC](https://forum.juce.com/t/aax-setlatencysamples-not-working/14714/4 "2015-04-30T13:21:23Z")

</div>

If you have an Avid Developer Account, please have a look here&nbsp;https://developer.digidesign.com/phpbb/viewtopic.php?f=95&t=1398

&nbsp;

---

<div class="post-metadata">

**Author:** ![chkn](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/chkn/32/3862_2.png) [@chkn](https://forum.juce.com/u/chkn)\
**Post date:** [April 30, 2015, 1:37pm UTC](https://forum.juce.com/t/aax-setlatencysamples-not-working/14714/5 "2015-04-30T13:37:00Z")

</div>

update, its working with the windows build of my plugin, but not with the mac version

---

<div class="post-metadata">

**Author:** ![fr810](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/fr810/32/841_2.png) [@fr810](https://forum.juce.com/u/fr810)\
**Post date:** [April 30, 2015, 1:42pm UTC](https://forum.juce.com/t/aax-setlatencysamples-not-working/14714/6 "2015-04-30T13:42:15Z")

</div>

Sorry I should have been more specific: AAX plug-ins report their latency to ProTools via the AAX controller's SetSignalLatency call. You report your plug-ins latency to JUCE via the AudioProcessor's setLatencySamples call. The way the AAX wrapper is written, the latency is only passed on to the DAW immedietely after a prepareToPlay call.&nbsp;In essence, your latency will only come into effect&nbsp;after JUCE calls your plug-ins&nbsp;prepareToPlay call which, in turn, is called when the sampleRate or sample buffer size changes or on plug-in initialization. Callng setLatencySamples outside of this function will not have an immediate effect. Therefore, my question was about when you call&nbsp;the AudioProcessor's setLatencySamples. Sorry for the confusion.

---

<div class="post-metadata">

**Author:** ![chkn](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/chkn/32/3862_2.png) [@chkn](https://forum.juce.com/u/chkn)\
**Post date:** [April 30, 2015, 2:20pm UTC](https://forum.juce.com/t/aax-setlatencysamples-not-working/14714/7 "2015-04-30T14:20:33Z")

</div>

okay my fault! Delay Compensation wasn't turned on in ProTools!

---

<div class="post-metadata">

**Author:** ![chkn](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/chkn/32/3862_2.png) [@chkn](https://forum.juce.com/u/chkn)\
**Post date:** [April 30, 2015, 2:23pm UTC](https://forum.juce.com/t/aax-setlatencysamples-not-working/14714/8 "2015-04-30T14:23:14Z")

</div>

\> Callng setLatencySamples outside of this function will not have an immediate effect. Therefore, my question was about when you call&nbsp;the AudioProcessor's setLatencySamples

Thats not right, you can call it every time and it works (if you turn delay compensation on ;-)

Sorry for wasting your time!!!

&nbsp;
