comparison playsound/playsound.c @ 343:03f47480200f

Now works correctly when specifying not all three of the --rate, --channels, and --format command line arguments.
author Ryan C. Gordon <icculus@icculus.org>
date Wed, 22 May 2002 09:30:52 +0000
parents f0f894d897bf
children cbb15ecf423a
comparison
equal deleted inserted replaced
342:fbbb1f25b944 343:03f47480200f
893 * Unless explicitly specified, pick the format from the sound 893 * Unless explicitly specified, pick the format from the sound
894 * to be played. 894 * to be played.
895 */ 895 */
896 if (use_specific_audiofmt) 896 if (use_specific_audiofmt)
897 { 897 {
898 /* Pick sensible default for any value not explicitly specified. */ 898 sdl_desired.freq = sample->desired.rate;
899 if (sound_desired.rate == 0) 899 sdl_desired.format = sample->desired.format;
900 sound_desired.rate = 44100; 900 sdl_desired.channels = sample->desired.channels;
901 if (sound_desired.format == 0)
902 sound_desired.format = AUDIO_S16SYS;
903 if (sound_desired.channels == 0)
904 sound_desired.channels = 2;
905
906 sdl_desired.freq = sound_desired.rate;
907 sdl_desired.format = sound_desired.format;
908 sdl_desired.channels = sound_desired.channels;
909 } /* if */ 901 } /* if */
910 else 902 else
911 { 903 {
912 sdl_desired.freq = sample->actual.rate; 904 sdl_desired.freq = sample->actual.rate;
913 sdl_desired.format = sample->actual.format; 905 sdl_desired.format = sample->actual.format;