Get output format.
0 on error. If the device was open the number of times it was opened will be returned. The values of the arguments variables are not set on an error.
Binds to C-function in SDL_mixer.h
int Mix_QuerySpec(int *frequency, Uint16 *format, int *channels)
// get and print the audio format in use int numtimesopened, frequency, channels; Uint16 format; numtimesopened=Mix_QuerySpec(&frequency, &format, &channels); if(!numtimesopened) { printf("Mix_QuerySpec: %s\n",Mix_GetError()); } else { char *format_str="Unknown"; switch(format) { case AUDIO_U8: format_str="U8"; break; case AUDIO_S8: format_str="S8"; break; case AUDIO_U16LSB: format_str="U16LSB"; break; case AUDIO_S16LSB: format_str="S16LSB"; break; case AUDIO_U16MSB: format_str="U16MSB"; break; case AUDIO_S16MSB: format_str="S16MSB"; break; } printf("opened=%d times frequency=%dHz format=%s channels=%d", numtimesopened, frequency, format, channels); }
SdlMixer Class | Tao.Sdl Namespace | Mix_OpenAudio