# Plugins with configurable latency

**URL:** <https://forum.juce.com/t/plugins-with-configurable-latency/9739>\
**Category:** Audio Plugins\
**Created:** [December 28, 2012, 4:27pm UTC](https://forum.juce.com/t/plugins-with-configurable-latency/9739 "2012-12-28T16:27:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![yairadix](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/yairadix/32/1114_2.png) [@yairadix](https://forum.juce.com/u/yairadix)\
**Post date:** [December 28, 2012, 4:27pm UTC](https://forum.juce.com/t/plugins-with-configurable-latency/9739/1 "2012-12-28T16:27:26Z")

</div>

Hi folks,

Did anyone make plugins which have configurable latency? (The user can change the latency and it gets saved in the preset)

I’m having a problem making it work in Logic, if I want my plugin’s default latency be non-zero.

What happens is:

- When a saved session is opened and the plugin is initialized, prepareToPlay gets called before setStateInformation (in which we know which latency setting we should use).
- For new plugin instance, setStateInformation is not called, so I have to report latency in prepareToPlay.
- But if I report the default latency in prepareToPlay, and then give another update in setStateInformation, Logic ignores the update and resumes with the wrong latency value ☹

Did anyone manage to make this work?

Thanks and Happy New Year! Yair
