Re: Is it safe to use memset() & memcpy() in my callback?
Re: Is it safe to use memset() & memcpy() in my callback?
- Subject: Re: Is it safe to use memset() & memcpy() in my callback?
- From: Steve gfx <email@hidden>
- Date: Tue, 5 Oct 2010 22:49:40 +0100
Thanks Paul, glad to hear it. Makes the code easier to read too.
On 5 Oct 2010, at 21:30, Paul Davis wrote:
> On Tue, Oct 5, 2010 at 4:11 PM, Steve gfx <email@hidden> wrote:
>> I've read various dos & don'ts about what is safe to run inside an input Audio Unit callback.
>> I'm sequencing lots of small sounds which I'm copying from memory in to the callback buffers.
>> Is it safe to use memcpy() to copy across my buffers, and memset(frameBuffer, 0, length) to silence the parts of the stream I need to?
>
> memcpy and memset are not blocking operations. they are safe to use in
> any realtime context. its also very useful that setting all 4 bytes of
> a float to zero corresponds to the numerical value of zero, and so
> yes, memset(buf,0,len) works as an easy way to write silence into a
> buffer.
_______________________________________________
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