Re: How to set buffer size for Audio Output Unit?
Re: How to set buffer size for Audio Output Unit?
- Subject: Re: How to set buffer size for Audio Output Unit?
- From: Christof Faller <email@hidden>
- Date: Thu, 30 Aug 2001 06:55:04 -0400
Hi Roger,
Thanks for the advice. Currently I am doing something quite similar
to what you propose. To generate the samples in the larger buffer
I create a thread (NSThread). The AudioUnitCallback then simply
talkes the samples from this buffer and writes them into the small
supplied buffer.
There are two issues with this solution:
1
Larger than necessary delay (it really would be best if I could
match my algorithm framesize with the AudioOutputUnit
framesize.
2
NSThread has not enough priority. So if I do some other
processing on MacOS X while the audio is playing, it
occasionnally breaks (unless I choose a very large
buffer).
If the AudioOutputUnit uses such small buffers I can't generate
the samples from within the context of the AudioUnitCallback
because my algorithm
for generating the samples is computationnally quite complex.
And my frame-size is quite large (I generate 1024 samples at once).
Therefore the time-slice of the callback function (AudioUnitCallback)
is not large enough to do the real-time processing. However if I
could increase the AudioOutputUnit buffer size, I could also spend
more time in the callback function,
Chris