Re: Trouble recording using the AUHAL unit.
Re: Trouble recording using the AUHAL unit.
- Subject: Re: Trouble recording using the AUHAL unit.
- From: Ross Bencina <email@hidden>
- Date: Tue, 12 Jan 2016 12:32:20 +1100
It's true that you shouldn't do file i/o in an audio thread (you
shouldn't printf either), however check whether you can achieve your
goals with Audio Queue Services. My (very limited) understanding is that
they take care of the queuing for you.
On 12/01/2016 5:07 AM, Alexander Bollbach wrote:
> but essentially, the ring buffer functions as a method of temporarily
> holding the audio samples in memory from the rendering function in the
> realtime thread and than quickly reading those samples for some other
> purpose elsewhere?
Yes.
> using the timestamp to coordinate what exactly?
You shouldn't need timestamps unless you're trying to synchronise with
something.
> and
> wouldn't the ring buffer eat its tail eventually if the realtime
> callback was dumping sample data into the ring buffer faster than i
> could write it to disk?
Yes, absolutely. Your disk thread needs to keep up. So long as you use a
big enough buffer you'll be fine.
There are ways to detect overflow.
> I'm sorry but i find this just a bit difficult
> to negotiate in my head.
As an alternative to a ring buffer you can use a linked chain of
write-behind buffers. I detail the approach in the paper linked here:
http://www.rossbencina.com/code/interfacing-real-time-audio-and-file-io
There's an animation of the reading-from-disk here:
http://www.rossbencina.com/static/writings/File_IO_ACMC2014_Bencina_Animation/filestreaming.htm
writing-to-disk is kinda the opposite.
There's also source code.
Like Paul, I can't really comment further on the CoreAudio frameworks. I
prefer not to be locked to a single vendor.
Cheers,
Ross.
_______________________________________________
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