12 #include "../stdafx.h" 18 #include "../safeguards.h" 31 MxMixSamples(stream, len / 4);
40 if (SDL_WasInit(SDL_INIT_EVERYTHING) == 0) {
41 ret_code = SDL_Init(SDL_INIT_AUDIO | SDL_INIT_NOPARACHUTE);
42 }
else if (SDL_WasInit(SDL_INIT_AUDIO) == 0) {
43 ret_code = SDL_InitSubSystem(SDL_INIT_AUDIO);
45 if (ret_code == -1)
return SDL_GetError();
48 spec.format = AUDIO_S16SYS;
52 MxInitialize(spec.freq);
53 SDL_OpenAudio(&spec, &spec);
61 SDL_QuitSubSystem(SDL_INIT_AUDIO);
62 if (SDL_WasInit(SDL_INIT_EVERYTHING) == 0) {
const char * Start(const char *const *param) override
Start this driver.
Factory for the SDL sound driver.
static FSoundDriver_SDL iFSoundDriver_SDL
Factory for the SDL sound driver.
int GetDriverParamInt(const char *const *parm, const char *name, int def)
Get an integer parameter the list of parameters.
static void CDECL fill_sound_buffer(void *userdata, Uint8 *stream, int len)
Callback that fills the sound buffer.
Base for playing sound via SDL.
void Stop() override
Stop this driver.