After a call to load - how do you know when it’s ready to process samples with the recently loaded impulse response. I can’t figure it out, it looks like it’s impossible to know?!
Yes it seems to be that way at present. At first read I thought the internal “isActive” bool had something to do with it, but then I realized this is more related to basic initial setup, as the engine defaults to loading unity impulses so that until an actual IR is loaded, audio in = audio out. I think isActive switches to true once this basic setup is done, and stays true thereafter.
There are definitely some ways the class might be able to provide this notification without too much trouble, maybe a callback connected to the callLater lambda and/or the MessageQueue pop method, but perhaps connecting it to when the Mixer is done the internal fade makes the most sense.
I think there are scenarios where multiple load messages sent in rapid succession creates a backlog in the queue, as I think the queue only pops the next IR change after the mixer is done fading from the old engine to the new one, which might present challenges keeping track of the callbacks.
But I suppose if the caller registering the callback kept track of how many callbacks it received compared to how many load calls it made, it would be possible to keep track of which IR load request a particular callback corresponded to.
So turns out there was a patch on develop 29 days ago, so if you call prepareToPlay after calling load you can guarantee the IR is loaded and ready.
I can see cases where this would still fail, but it works for us for now!