SDL_OpenAudioDevice fail

This code make nothing, not callback at all:

SDL_OpenAudioDevice(SDL_GetAudioDeviceName(0, 0), 0, &audio_req, NULL, SDL_AUDIO_ALLOW_ANY_CHANGE)

this fail also

SDL_OpenAudioDevice(NULL, 0, &audio_req, NULL, SDL_AUDIO_ALLOW_ANY_CHANGE)

Both return 2 but have only two devices according to SDL_GetNumAudioDevices(0)

SDL_OpenAudio(&audio_req, &audio_get) works with the same audio_req input.

How can I change/select the audio device with SDL ?

You won’t receive a callback until you unpause the audio with SDL_PauseAudioDevice() (it’s initially opened in the paused state).

Working :slight_smile:

So, SDL_PauseAudioDevice(); not SDL_PauseAudio();
SDL have double 64 format ?

PauseAudio is a leftover from SDL 1.2, but it’s still useful for apps with very simple audio needs (but unfortunately confusing because you can’t really mix it with the newer API).

There isn’t double (64-bit) floating point sample support. Float32 is supported, though!