I am not sure whether using memory management functions in an audio callback is a problem
Yikes!
http://www.rossbencina.com/code/real-time-audio-programming-101-time-waits-for-nothing