# HG changeset patch # User Ryan C. Gordon # Date 1255156331 0 # Node ID aecbdf3362c3baec86c961929be7ba9f0104accb # Parent 1164528004ffb828c0ade927e4aebee2760334f7 Added some debug output to loopwave.c diff -r 1164528004ff -r aecbdf3362c3 test/loopwave.c --- a/test/loopwave.c Sat Oct 10 05:27:59 2009 +0000 +++ b/test/loopwave.c Sat Oct 10 06:32:11 2009 +0000 @@ -64,9 +64,14 @@ done = 1; } + +#define NAMESIZE 32 + int main(int argc, char *argv[]) { + char name[NAMESIZE]; + /* Load the SDL library */ if (SDL_Init(SDL_INIT_AUDIO) < 0) { fprintf(stderr, "Couldn't initialize SDL: %s\n", SDL_GetError()); @@ -101,9 +106,15 @@ SDL_FreeWAV(wave.sound); quit(2); } - SDL_PauseAudio(0); + + /* Right now we're using the 1.2 SDL_OpenAudio(), but if we move to the + 1.3 device enumeration version, we shouldn't hardcore device id #1 for + SDL_GetAudioDeviceName(), below. */ + printf("Using audio driver: %s\n", SDL_AudioDriverName(name, NAMESIZE)); + printf("Using audio device: %s\n", SDL_GetAudioDeviceName(1, 0)); /* Let the audio run */ + SDL_PauseAudio(0); while (!done && (SDL_GetAudioStatus() == SDL_AUDIO_PLAYING)) SDL_Delay(1000);