Get the preferred audio format of a specific audio device.
Defined in SDL_audio.h
int SDL_GetAudioDeviceSpec(int index,
int iscapture,
SDL_AudioSpec *spec);
int | index | the index of the audio device; valid values range from 0 to SDL_GetNumAudioDevices() - 1. |
int | iscapture | non-zero to query the list of recording devices, zero to query the list of output devices. |
SDL_AudioSpec * | spec | The SDL_AudioSpec to be initialized by this function. |
(int) Returns 0 on success, nonzero on error.
This function is only valid after a successfully initializing the audio subsystem. The values returned by this function reflect the latest call to SDL_GetNumAudioDevices(); re-call that function to redetect available hardware.
spec
will be filled with the sample rate, sample format, and channel count.
This function is available since SDL 2.0.16.