ExtAudioFileWriteAsync is... semi-broken?
ExtAudioFileWriteAsync is... semi-broken?
- Subject: ExtAudioFileWriteAsync is... semi-broken?
- From: Seth Willits <email@hidden>
- Date: Sun, 30 Oct 2011 11:59:48 -0700
ExtAudioFileWriteAsync is throwing kExtAudioFileError_AsyncWriteBufferOverflow, and I'm trying to figure out why it happens and what to do about it. The documentation merely says: "An asynchronous write operation could not be completed in time." and offers no suggestions or hints about what to do.
Since ExtAudioFileWriteAsync says it writes to a ring buffer, and then that data is continuously written to the file in the background, it seems pretty clear that this buffer has filled up and thus ExtAudioFileWriteAsync throws an error saying it can't write anything else into it.
Once this occurs, then what? There's no function to flush the buffer to the file, so there's no way to force it back into a working state, and it's not like I have any indicator as to why the buffer is full or a way to prevent it from becoming full. The only thing I can think of to do is start caching the buffers being given to me (by an AudioOutputUnit), and send them to ExtAudioFileAsync later on. But then that's really kinda wonky and involves extra memory copies etc, but then why use Async at all in that case since I'm basically replicating what it's supposed to be doing. So.... this function seems kinda useless and I dare say semi-broken because I don't see how it can work as intended.
A quick change in my app to call the synchronous version instead, works perfectly fine, but I have a feeling that Async exists for a reason, so I'm probably missing some important thing about why Async is better. But what?
Any thoughts?
--
Seth Willits
_______________________________________________
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