Identifying a "non-callback device" for audio

I am still trying to set up basic audio output with SDL2, and I see two documentation pages that have seemingly conflicting descriptions of callback functions:

SDL2/SDL_QueueAudio - SDL2 Wiki says “Queue more audio on non-callback devices.” which I think implies that the device determines whether it uses a callback or not.

SDL2/SDL_OpenAudioDevice - SDL2 Wiki says that I can determine if the device uses a callback by whether I enter a function into AudioSpec *desired or not.

Do I need to identify some property of the device before I decide if I want to use a callback function? Or can I just make that decision for myself when I open the device?

You just make the decision when you open the device, depending on how you want to provide audio data.

The “callback device” vs “non-callback device” is just to denote how the logical device was created, and not some aspect of the physical audio hardware or anything like that.

2 Likes