Re: Best approach for audiofile reader worker thread
Re: Best approach for audiofile reader worker thread
- Subject: Re: Best approach for audiofile reader worker thread
- From: William Stewart <email@hidden>
- Date: Mon, 20 Apr 2009 12:27:49 -0700
On Apr 19, 2009, at 1:20 AM, Mark's Studio wrote:
What is the best approach for setting up a audiofile reader worker
thread on the iPhone?
I need to read several files, so far it's been fine just reading
them with ExtAudioFileRead() in the render callback (small files,
linear PCM no conversion) and not on every callback,
but i also want to read some big files, and now it starts to block
the callback and i get dropouts.
well, you shouldn't be doing *any* reads on the render callback from
an audio unit chain that is doing audio device I/O
You are in a realtime thread, that has a constrained time/deadline to
meet and accessing the file system can block. (same reason for not
allocating on this thread)
The fact that you aren't glitching already - you're just getting lucky.
Bill
_______________________________________________
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