1.1 --- a/test/loopwave.c Sat Oct 10 05:27:59 2009 +0000
1.2 +++ b/test/loopwave.c Sat Oct 10 06:32:11 2009 +0000
1.3 @@ -64,9 +64,14 @@
1.4 done = 1;
1.5 }
1.6
1.7 +
1.8 +#define NAMESIZE 32
1.9 +
1.10 int
1.11 main(int argc, char *argv[])
1.12 {
1.13 + char name[NAMESIZE];
1.14 +
1.15 /* Load the SDL library */
1.16 if (SDL_Init(SDL_INIT_AUDIO) < 0) {
1.17 fprintf(stderr, "Couldn't initialize SDL: %s\n", SDL_GetError());
1.18 @@ -101,9 +106,15 @@
1.19 SDL_FreeWAV(wave.sound);
1.20 quit(2);
1.21 }
1.22 - SDL_PauseAudio(0);
1.23 +
1.24 + /* Right now we're using the 1.2 SDL_OpenAudio(), but if we move to the
1.25 + 1.3 device enumeration version, we shouldn't hardcore device id #1 for
1.26 + SDL_GetAudioDeviceName(), below. */
1.27 + printf("Using audio driver: %s\n", SDL_AudioDriverName(name, NAMESIZE));
1.28 + printf("Using audio device: %s\n", SDL_GetAudioDeviceName(1, 0));
1.29
1.30 /* Let the audio run */
1.31 + SDL_PauseAudio(0);
1.32 while (!done && (SDL_GetAudioStatus() == SDL_AUDIO_PLAYING))
1.33 SDL_Delay(1000);
1.34