What does the '2' stand for in the following :
SLDataLocator_AndroidSimpleBufferQueue loc_bq =
{SL_DATALOCATOR_ANDROIDSIMPLEBUFFERQUEUE, 2};
From what I've read, it is the number of buffers.
Why 2? Why not just 1 ? And if 2 is better, why not 10 then to make it even better?
Thanks
Why 2?
If you've got 2 buffers you can fill up one with new data while the other is playing. Additionaly, it just so happens that up until recently you were required to have at least 2 buffers in your buffer queue if you wanted to be able to use Android's low-latency audio path.
Why not just 1 ?
Filling up the buffer with new data becomes quite tricky if you've only got a single buffer, since you risk not being able to generate new data fast enough.
And if 2 is better, why not 10 then to make it even better?
As you increase the number of buffers you also increase the latency (the time from when you enqueue a buffer until when that buffer will be played), assuming that you keep the buffer sizes the same.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With