List soundcards
authorTomas Mudrunka <tomas@mudrunka.cz>
Fri, 10 Jun 2022 23:44:16 +0000 (01:44 +0200)
committerTomas Mudrunka <tomas@mudrunka.cz>
Fri, 10 Jun 2022 23:44:16 +0000 (01:44 +0200)
c/SDL2_record_audio/main.c

index b44278273d8bc9ad5ebda410d08945e0ef2a9779..566e4f09b911633cbabb6d93e95f7d73d076705a 100644 (file)
@@ -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());
This page took 0.234979 seconds and 4 git commands to generate.