playwave.c
changeset 245 63b3650714de
parent 241 503416fca921
child 321 a72a7f07c8f1
     1.1 --- a/playwave.c	Fri Aug 20 19:32:09 2004 +0000
     1.2 +++ b/playwave.c	Sat Aug 21 12:27:02 2004 +0000
     1.3 @@ -266,7 +266,7 @@
     1.4  
     1.5  static void Usage(char *argv0)
     1.6  {
     1.7 -	fprintf(stderr, "Usage: %s [-8] [-r rate] [-f] [-F] [-l] [-m] <wavefile>\n", argv0);
     1.8 +	fprintf(stderr, "Usage: %s [-8] [-r rate] [-c channels] [-f] [-F] [-l] [-m] <wavefile>\n", argv0);
     1.9  }
    1.10  
    1.11  
    1.12 @@ -360,6 +360,10 @@
    1.13  		if ( strcmp(argv[i], "-m") == 0 ) {
    1.14  			audio_channels = 1;
    1.15  		} else
    1.16 +		if ( (strcmp(argv[i], "-c") == 0) && argv[i+1] ) {
    1.17 +			++i;
    1.18 +			audio_channels = atoi(argv[i]);
    1.19 +		} else
    1.20  		if ( strcmp(argv[i], "-l") == 0 ) {
    1.21  			loops = -1;
    1.22  		} else
    1.23 @@ -398,6 +402,7 @@
    1.24  		Mix_QuerySpec(&audio_rate, &audio_format, &audio_channels);
    1.25  		printf("Opened audio at %d Hz %d bit %s", audio_rate,
    1.26  			(audio_format&0xFF),
    1.27 +			(audio_channels > 2) ? "surround" :
    1.28  			(audio_channels > 1) ? "stereo" : "mono");
    1.29  		if ( loops ) {
    1.30  		  printf(" (looping)\n");