Get the human-readable name of a specific audio device.
Defined in <SDL3/SDL_audio.h>
devid | the instance ID of the device to query. |
Returns the name of the audio device, or NULL on error.
The string returned by this function is UTF-8 encoded. The caller should call SDL_free on the return value when done with it.
It is safe to call this function from any thread.
This function is available since SDL 3.0.0.
int count;
SDL_AudioDeviceID *devices;
devices = SDL_GetAudioOutputDevices(&count);
for (int i = 0; i < count; ++i) {
SDL_Log("Audio device %d: %s", i, SDL_GetAudioDeviceName(devices[i]));
}
SDL_free(devices);