mirror of
https://github.com/yawut/SDL.git
synced 2026-08-19 23:34:04 -05:00
Merged SDL-ryan-multiple-audio-device branch r2803:2871 into the trunk.
This commit is contained in:
@@ -69,26 +69,12 @@ main(int argc, char *argv[])
|
||||
{
|
||||
int i, n;
|
||||
|
||||
/* Print available audio drivers */
|
||||
n = SDL_GetNumAudioDrivers();
|
||||
if (n == 0) {
|
||||
printf("No built-in audio drivers\n");
|
||||
} else {
|
||||
printf("Built-in audio drivers:");
|
||||
for (i = 0; i < n; ++i) {
|
||||
if (i > 0) {
|
||||
printf(",");
|
||||
}
|
||||
printf(" %s", SDL_GetAudioDriver(i));
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
/* Load the SDL library */
|
||||
if (SDL_Init(SDL_INIT_AUDIO) < 0) {
|
||||
fprintf(stderr, "Couldn't initialize SDL: %s\n", SDL_GetError());
|
||||
return (1);
|
||||
}
|
||||
|
||||
if (argv[1] == NULL) {
|
||||
argv[1] = "sample.wav";
|
||||
}
|
||||
@@ -120,7 +106,6 @@ main(int argc, char *argv[])
|
||||
SDL_PauseAudio(0);
|
||||
|
||||
/* Let the audio run */
|
||||
printf("Using audio driver: %s\n", SDL_GetCurrentAudioDriver());
|
||||
while (!done && (SDL_GetAudioStatus() == SDL_AUDIO_PLAYING))
|
||||
SDL_Delay(1000);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user