where to grab Engine.getSampleRate() ?
-
I'm working on a convolution project that loads audiofiles based on the host sample rate.
Placing Engine.getSampleRate() on init retuns a value of -1 because it's initialized before the samplerate is queried.
In the past, I've placed the getSampleRate function inside PrepareToPlay of a scriptFX, and this works fine.
This project is using a compiled scriptnode dll and I'm throwing that into a HardcodedFX module so I'm thinking there's a better way to do this. What would you do? -
@Dan-Korneff the prepare callback of a script fx (without a network).
-
@Christoph-Hart global variable , right?
-
@Dan-Korneff yeah that's what I do
-
yup that's one of the good occasions of using global variables.
I could add a broadcaster source that listens to audio spec changes, then you could just attach it inside the main script and wouldn't need to add a script FX only for this.
-