I was getting the same error. Further digging made me find out it's because of high memory usage. wrapping the body of the loop inside autoreleasepool fixed it in my case. This answer on stackoverflow helped me a lot.
Topic:
Media Technologies
SubTopic:
Audio
Tags: