I’m not sure I fully understand what the samples value is supposed to represent or otherwise affect.
Since there seems to be no correlation between the sample (audio buffer) size and the data size sent to SDL_QueueAudio. From the wiki: There are no limits on the amount of data you can queue, short of exhaustion of address space.
If I change the samples (buffer size) value what does it affect exactly?
Maybe I get it! With the exception of mono audio the channel data is interleaved in the data stream. So the data I am sending to QueueAudio is interleaved in sizes of sample!!! Yes/No?
Just a wild guess, but I’m guessing the sample size is a hold over from the SDL 1 days. This Audio example, shows this wanted.samples = 1024; /* Good low-latency value for callback */. A larger buffer would queue up more data causing a potential lag in audio being played. With the new queuing system, this isn’t needed as much.
SDL_QueueAudio() came way later, and had to use the existing interfaces. 1024 is a reasonable number there for SDL_QueueAudio use (in this case, it’s how much of the queue it will want to drain every time the internal callback function fires…there’s still a callback, it’s just handled internally by SDL).