test/loopwave.c
branchSDL-1.3
changeset 1660 8b9d79e7eacf
parent 1659 14717b52abc0
child 1662 782fd950bd46
     1.1 --- a/test/loopwave.c	Wed May 17 08:18:28 2006 +0000
     1.2 +++ b/test/loopwave.c	Sat May 20 04:35:58 2006 +0000
     1.3 @@ -62,7 +62,22 @@
     1.4  
     1.5  int main(int argc, char *argv[])
     1.6  {
     1.7 -	char name[32];
     1.8 +	int i, n;
     1.9 +
    1.10 +	/* Print available audio drivers */
    1.11 +	n = SDL_GetNumAudioDrivers();
    1.12 +	if ( n == 0 ) {
    1.13 +		printf("No built-in audio drivers\n");
    1.14 +	} else {
    1.15 +		printf("Built-in audio drivers:");
    1.16 +		for ( i = 0; i < n; ++i ) {
    1.17 +			if ( i > 0 ) {
    1.18 +				printf(",");
    1.19 +			}
    1.20 +			printf(" %s", SDL_GetAudioDriver(i));
    1.21 +		}
    1.22 +		printf("\n");
    1.23 +	}
    1.24  
    1.25  	/* Load the SDL library */
    1.26  	if ( SDL_Init(SDL_INIT_AUDIO) < 0 ) {
    1.27 @@ -102,7 +117,7 @@
    1.28  	SDL_PauseAudio(0);
    1.29  
    1.30  	/* Let the audio run */
    1.31 -	printf("Using audio driver: %s\n", SDL_AudioDriverName(name, 32));
    1.32 +	printf("Using audio driver: %s\n", SDL_GetCurrentAudioDriver());
    1.33  	while ( ! done && (SDL_GetAudioStatus() == SDL_AUDIO_PLAYING) )
    1.34  		SDL_Delay(1000);
    1.35