Win32 sdl_mixer : sound doesn't work if SDL_init

I’ve already searched in archive and found nothing about this problem.

I’ve noticed that in order to have sound playing under windows I need to not do SDL_init. But to have events working, I need to do SDL_init(SDL_INIT_VIDEO). So is it normal that I must avoid SDL_init for sound playback ? if yes, how can I resolve my problem ?

Everything is working under GNU/Linux…

Thx

Francois

Francois GAUDIN napisa?(a):

I’ve already searched in archive and found nothing about this problem.

I’ve noticed that in order to have sound playing under windows I need to not do SDL_init. But to have events working, I need to do SDL_init(SDL_INIT_VIDEO). So is it normal that I must avoid SDL_init for sound playback ? if yes, how can I resolve my problem ?

Everything is working under GNU/Linux…

Thx

Francois
Try:
SDL_Init(SDL_INIT_EVERYTHING);

Check SDL_Mixer:
snd=Mix_LoadWAV(“snd.wav”);
Mix_PlayChannel(chan,wav,loop);

I’ve already searched in archive and found nothing about this problem.

I’ve noticed that in order to have sound playing under windows I need to not do SDL_init. But to have events working, I need to do SDL_init(SDL_INIT_VIDEO). So is it normal that I must avoid SDL_init for sound playback ? if yes, how can I resolve my problem ?

Everything is working under GNU/Linux…

Thx

Francois

Something else must be wrong…I’m using SDL_Init in Windows and my
sound works. Of course that’s calling it this way:

SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO);

If you’ve left out the SDL_INIT_AUDIO then there’s no reason why it
should work because you didn’t tell it to initialize the audio subsystem.

Matt