summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 605f954)
raw | patch | inline | side by side (parent: 605f954)
author | Ketmar Dark <ketmar@ketmar.no-ip.org> | |
Thu, 7 Apr 2016 18:18:27 +0000 (21:18 +0300) | ||
committer | Ketmar Dark <ketmar@ketmar.no-ip.org> | |
Thu, 7 Apr 2016 18:18:27 +0000 (21:18 +0300) |
src/engine/e_sound_sdl.inc | patch | blob | history | |
src/game/g_options.pas | patch | blob | history |
index ce644a70a77c70f10a23deaf6d654544beefd43a..541f31a908239b7e0d05417ab52cfe1394279bbc 100644 (file)
if (res and MIX_INIT_OGG) <> 0 then e_WriteLog('SDL: OGG playback is active', MSG_NOTIFY);
if (res and MIX_INIT_FLUIDSYNTH) <> 0 then e_WriteLog('SDL: FLUIDSYNTH playback is active', MSG_NOTIFY);
- res := Mix_OpenAudio(44100, AUDIO_S16LSB, 2, 2048);
+ e_WriteLog(Format('SDL: initializing mixer at %d with buffer %d', [gsSDLSampleRate, gsSDLBufferSize]), MSG_NOTIFY);
+ res := Mix_OpenAudio(gsSDLSampleRate, AUDIO_S16LSB, 2, gsSDLBufferSize);
if res = -1 then
begin
e_WriteLog('Error initializing SDL mixer:', MSG_FATALERROR);
diff --git a/src/game/g_options.pas b/src/game/g_options.pas
index f6ffc77ee61f09caa8d911249fe063b7198389c8..3f134305da197592e652a1958cda9e74fd2a4b6d 100644 (file)
--- a/src/game/g_options.pas
+++ b/src/game/g_options.pas
gnWeaponStay: Boolean = False;
gnMonsters: Boolean = False;
gnBotsVS: String = 'Everybody';
+ gsSDLSampleRate: Integer = 44100;
+ gsSDLBufferSize: Integer = 2048;
implementation
gMuteWhenInactive := config.ReadBool('Sound', 'MuteInactive', False);
gAnnouncer := Min(Max(config.ReadInt('Sound', 'Announcer', ANNOUNCE_MEPLUS), ANNOUNCE_NONE), ANNOUNCE_ALL);
gSoundEffectsDF := config.ReadBool('Sound', 'SoundEffectsDF', True);
+ gsSDLSampleRate := Min(Max(config.ReadInt('Sound', 'SDLSampleRate', 44100), 11025), 96000);
+ gsSDLBufferSize := Min(Max(config.ReadInt('Sound', 'SDLBufferSize', 2048), 64), 16384);
with gGameControls.GameControls do
begin
config.WriteBool('Sound', 'MuteInactive', gMuteWhenInactive);
config.WriteInt('Sound', 'Announcer', gAnnouncer);
config.WriteBool('Sound', 'SoundEffectsDF', gSoundEffectsDF);
+ config.WriteInt('Sound', 'SDLSampleRate', gsSDLSampleRate);
+ config.WriteInt('Sound', 'SDLBufferSize', gsSDLBufferSize);
with config, gGameControls.GameControls do
begin