From: Tomas Mudrunka Date: Fri, 10 Jun 2022 23:44:16 +0000 (+0200) Subject: List soundcards X-Git-Url: https://git.harvie.cz/?a=commitdiff_plain;h=41163fe463c6a186dfe2be88bd72a3f396ca78e1;p=mirrors%2FPrograms.git List soundcards --- diff --git a/c/SDL2_record_audio/main.c b/c/SDL2_record_audio/main.c index b442782..566e4f0 100644 --- a/c/SDL2_record_audio/main.c +++ b/c/SDL2_record_audio/main.c @@ -28,6 +28,11 @@ int main(void) { exit(-1); } + int i, count = SDL_GetNumAudioDevices(0); + for (i = 0; i < count; ++i) { + printf("Audio device %d: %s\n", i, SDL_GetAudioDeviceName(i, 0)); + } + dev = SDL_OpenAudioDevice(NULL, 1, &want, &have, SDL_AUDIO_ALLOW_FORMAT_CHANGE); if (dev == 0) { SDL_Log("Failed to open audio: %s", SDL_GetError());