From c31db37bc1289c0ef7af70bdbd2474406a4cc7b4 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Thu, 29 Nov 2012 09:48:42 -0800 Subject: [PATCH] Print the list of audio drivers so you can try each one --- test/loopwave.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/loopwave.c b/test/loopwave.c index 3cb664020..8e7604111 100644 --- a/test/loopwave.c +++ b/test/loopwave.c @@ -78,6 +78,8 @@ poked(int sig) int main(int argc, char *argv[]) { + int i; + /* Load the SDL library */ if (SDL_Init(SDL_INIT_AUDIO) < 0) { fprintf(stderr, "Couldn't initialize SDL: %s\n", SDL_GetError()); @@ -106,6 +108,17 @@ main(int argc, char *argv[]) signal(SIGTERM, poked); #endif /* HAVE_SIGNAL_H */ + /* Show the list of available drivers */ + printf("Available audio drivers: "); + for (i = 0; i < SDL_GetNumAudioDrivers(); ++i) { + if (i == 0) { + printf("%s", SDL_GetAudioDriver(i)); + } else { + printf(", %s", SDL_GetAudioDriver(i)); + } + } + printf("\n"); + /* Initialize fillerup() variables */ if (SDL_OpenAudio(&wave.spec, NULL) < 0) { fprintf(stderr, "Couldn't open audio: %s\n", SDL_GetError()); @@ -126,3 +139,5 @@ main(int argc, char *argv[]) SDL_Quit(); return (0); } + +/* vi: set ts=4 sw=4 expandtab: */