Posts

Post not yet marked as solved
3 Replies
Thanks for your post - it pointed me to the right direction after trying to get this work for two days!!!
Post not yet marked as solved
7 Replies
Dear Alan,The Apple code support confirmed that my code is correct and this is a bug. He asked me to file a bug report - what I did right now. I assume this will take some time this is sorted out.About your solution: When creating a weak self this should be fine ... I have done something similar in a past project and it worked!I also found this forum discussion that could be of interest for you: https://forums.developer.apple.com/thread/39193Take care!
Post not yet marked as solved
7 Replies
Dear Alan,I received feedback from Apple code support (see below) - actually this is what I did before. I could manage to get the timer to fire in UIViewcontroller now - my fault - but it is still not working correct. I only get one update right after start, then nothing!The best answer I have so far is that there’s no really direct way to do this as some kind of observation, but it can be done via polling. The steps would be:— Create a new parameter in your parameter tree to hold the value you want to return from rendering.— Use the “kAudioUnitParameterFlag_MeterReadOnly” flag on this parameter to make it read-only from the view controller’s point of view.— In the kernel's render function, store your computed value in local storage of the audio unit.— Implement the “implementorValueProvider” method (https://developer.apple.com/documentation/audiotoolbox/auparameternode/1439942-implementorvalueprovider) in your audio unit. That method would simply return the current stored value (assuming that’s what you want).— Create a Timer object in your view controller, set to repeat (say) 20 times a second or less. When the timer fires, query the value of the parameter you added to the parameter tree, using the usual “AUParameter.value” property.— Update the UI with this value, if it has changed.The timer fire rate is low enough that it won’t add significant overhead, yet it should be responsive enough to produce smooth changes in your UI.
Post not yet marked as solved
7 Replies
Dear Alan,Thanks for your reply - it's good to know that I'm not the only one who is having this issue! So you choosed the "polling approach" - too bad that this have side effects on multiple instances!Yesterday I've sacrificed one of my valuable free TSI tickets to get an official answer from Apple on how to implement such functionality. I will keep you updated once I have a feedback. Best regards,