12 #include "../stdafx.h"
18 #include "../safeguards.h"
30 MxMixSamples(stream, len / 4);
39 if (SDL_WasInit(SDL_INIT_EVERYTHING) == 0) {
40 ret_code = SDL_Init(SDL_INIT_AUDIO | SDL_INIT_NOPARACHUTE);
41 }
else if (SDL_WasInit(SDL_INIT_AUDIO) == 0) {
42 ret_code = SDL_InitSubSystem(SDL_INIT_AUDIO);
44 if (ret_code == -1)
return SDL_GetError();
47 spec.format = AUDIO_S16SYS;
51 MxInitialize(spec.freq);
52 SDL_OpenAudio(&spec, &spec);
60 SDL_QuitSubSystem(SDL_INIT_AUDIO);
61 if (SDL_WasInit(SDL_INIT_EVERYTHING) == 0) {
Factory for the SDL sound driver.
std::optional< std::string_view > Start(const StringList ¶m) override
Start this driver.
void Stop() override
Stop this driver.
int GetDriverParamInt(const StringList &parm, const char *name, int def)
Get an integer parameter the list of parameters.
static FSoundDriver_SDL iFSoundDriver_SDL
Factory for the SDL sound driver.
static void CDECL fill_sound_buffer(void *, Uint8 *stream, int len)
Callback that fills the sound buffer.
Base for playing sound via SDL.
std::vector< std::string > StringList
Type for a list of strings.