[SDL] SDL_Mixer

Neil Bradley nb at synthcom.com
Mon Jan 6 20:08:02 PST 2003

> my problem is that the sound is not going out the speakers. the
> program compiles allright and the program run all the time the sound
> last. but (i repeat) no sound is coming out,

Are you getting calls to your defined callback when you open the device?
Are you getting an error code back from SDL_OpenAudio? You need to open a
stream and do the work before SDL_Mixer will work.

Example below for opening an audio stream:

	sDesired.freq = dwSamplingRate;
	sDesired.samples = AUDIO_BUFFER_SIZE;
	sDesired.callback = SDLAudioCallback;

	s32SDLResult = SDL_OpenAudio(&sDesired,

	if (s32SDLResult < 0)
		// Couldn't open things up



Neil Bradley            In the land of the blind, the one eyed man is not
Synthcom Systems, Inc.  king - he's a prisoner.
ICQ #29402898

More information about the SDL mailing list