Porblems using SDL_sound

Dark Haruka dark_haruka at web.de
Sun Jan 9 16:53:11 EST 2005


Hello!

I'm trying to play a MP3 Sound with SDL_sound.
But I have got big Problems with it. I have downloaded the files fom the icculus webiste.
In my Project folder I have put the folowing files sdl_sound.dll, smpeg.dll, vorbis.dll, vorbisfile.dll and ogg.dll. In my programm I have included the files SDL.h and SDL_sound.h and the libs SDLmain.lib, SDL.lib and sdl_sound.lib

Then I have searched for a sample and I have found this:

static volatile int still_playing_audio = 1;

int main(void)
{
	SDL_Init(SDL_INIT_AUDIO);
	Sound_Init();
	Sound_Sample *sample;
	sample = Sound_NewSampleFromFile("mysound.mp3", NULL, 16384);

	SDL_AudioSpec devspec;
	memcpy(&devspec, &sample->actual, sizeof (SDL_AudioSpec));
	devspec.samples = 4096;
	devspec.userdata = sample;

	Sound_Decode(sample);

	still_playing_audio = 1;
	SDL_OpenAudio(&devspec, NULL);
	SDL_PauseAudio(0);

	while (still_playing_audio)
		 SDL_Delay(10);  // sleep awhile.

	SDL_Quit();
	Sound_FreeSample(sample);
}

But this doesn't work. The programm chrases only. the file mysound.mp3 is a MP3 Song ans it's located in the project directory.

Can somebody tell me, how I can play one MP3 file with SDL_sound? Or does anyone know a tutorial on it?

Thank you very much in advance :)
__________________________________________________________
Mit WEB.DE FreePhone mit hoechster Qualitaet ab 0 Ct./Min.
weltweit telefonieren! http://freephone.web.de/?mc=021201




More information about the sdlsound mailing list