Function sdl2_sys::SDL_GetAudioDeviceSpec
source · pub unsafe extern "C" fn SDL_GetAudioDeviceSpec(
index: c_int,
iscapture: c_int,
spec: *mut SDL_AudioSpec
) -> c_int
Expand description
Get the preferred audio format of a specific audio device.
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. All other values in the structure are filled with 0. When the
supported struct members are 0, SDL was unable to get the property from the
backend.
\param index the index of the audio device; valid values range from 0 to SDL_GetNumAudioDevices() - 1 \param iscapture non-zero to query the list of recording devices, zero to query the list of output devices. \param spec The SDL_AudioSpec to be initialized by this function. \returns 0 on success, nonzero on error
\since This function is available since SDL 2.0.16.
\sa SDL_GetNumAudioDevices