test/testaudioinfo.c
changeset 3635 5ea5e4e6103f
parent 3338 9de326b3099c
child 5535 96594ac5fd1a
equal deleted inserted replaced
3634:1e31a24c41a6 3635:5ea5e4e6103f
    23 }
    23 }
    24 
    24 
    25 int
    25 int
    26 main(int argc, char **argv)
    26 main(int argc, char **argv)
    27 {
    27 {
       
    28     /* Load the SDL library */
       
    29     if (SDL_Init(SDL_INIT_AUDIO) < 0) {
       
    30         fprintf(stderr, "Couldn't initialize SDL: %s\n", SDL_GetError());
       
    31         return (1);
       
    32     }
       
    33 
    28     /* Print available audio drivers */
    34     /* Print available audio drivers */
    29     int n = SDL_GetNumAudioDrivers();
    35     int n = SDL_GetNumAudioDrivers();
    30     if (n == 0) {
    36     if (n == 0) {
    31         printf("No built-in audio drivers\n\n");
    37         printf("No built-in audio drivers\n\n");
    32     } else {
    38     } else {
    36             printf("  %s\n", SDL_GetAudioDriver(i));
    42             printf("  %s\n", SDL_GetAudioDriver(i));
    37         }
    43         }
    38         printf("\n");
    44         printf("\n");
    39     }
    45     }
    40 
    46 
    41     /* Load the SDL library */
       
    42     if (SDL_Init(SDL_INIT_AUDIO) < 0) {
       
    43         fprintf(stderr, "Couldn't initialize SDL: %s\n", SDL_GetError());
       
    44         return (1);
       
    45     }
       
    46 
       
    47     printf("Using audio driver: %s\n\n", SDL_GetCurrentAudioDriver());
    47     printf("Using audio driver: %s\n\n", SDL_GetCurrentAudioDriver());
    48 
    48 
    49     print_devices(0);
    49     print_devices(0);
    50     print_devices(1);
    50     print_devices(1);
    51 
    51