Do what Gregory is doing and read the docs for each function that you call. The basic idea is that Objective-C messages have a very small chance that they could block so you can't use them. As fas as C functions go, you have to research each one to find out if they can possibly block. The Documentation doesn't always explicitly say whether or not they will block so you might have to experiment. Avoid functions with words like "new" or "destroy" in them that might allocate on the heap.
Dave
On Jan 27, 2015, at 9:41 AM, Gregory Wieber < email@hidden> wrote: There's a special consideration note in the docs for AudioUnitGetProperty that says if it's a core foundation object getting returned (like a dictionary, let's say), then a duplication will happen according to the "create rule" -- meaning you have to release it.
To me that implies an allocation would be taking place in that situation.
Michael Tyson also has an article on using a circular buffer to pass messages back and forth between the core audio thread and the main thread. You might want to check that out too.
Greg
Sent from my iPhone
On Jan 27, 2015, at 9:29 AM, Mark Wise < email@hidden> wrote: Michael Tyson, author of TheAmazingAudioEngine, recommended this article to me: http://www.rossbencina.com/code/real-time-audio-programming-101-time-waits-for-nothing
It doesn't address your question directly, but it's a good baseline for explaining the types of things that should be avoided.
I'm not an expert, but I would suspect that the AudioUnitGetProperty() is safe to call, since it is a C function and satisfies the "your audio thread code should be only C - never Obj-C" dictum. That said, it's possible that I'm completely wrong, so take that with a grain of salt!
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
|