summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 17b6ed0)
raw | patch | inline | side by side (parent: 17b6ed0)
author | fgsfds <pvt.fgsfds@gmail.com> | |
Wed, 4 Sep 2019 16:19:10 +0000 (19:19 +0300) | ||
committer | fgsfds <pvt.fgsfds@gmail.com> | |
Wed, 4 Sep 2019 16:19:10 +0000 (19:19 +0300) |
src/engine/e_soundfile_modplug.pas | patch | blob | history | |
src/engine/e_soundfile_xmp.pas | patch | blob | history | |
src/game/g_sound.pas | patch | blob | history |
index 9f74a1683ea00a661f6f5bd6678dd10444d7cb21..b68487d9600d9667e4d6e5d9e852ad454e71fca1 100644 (file)
function TModPlugLoaderFactory.GetLoader(): TSoundLoader;
begin
- ModPlug_SetSettings(@Settings); // update settings just in case
+ // update interpolation setting
+ if e_MusicLerp then
+ Settings.mResamplingMode := MODPLUG_RESAMPLE_LINEAR
+ else
+ Settings.mResamplingMode := MODPLUG_RESAMPLE_NEAREST;
+ ModPlug_SetSettings(@Settings);
Result := TModPlugLoader.Create();
end;
index afbadf3ad8d73dc63b0ba3b018acedca6bfce3cf..d3e4da5809fc6edb59a2140fb87ae0ded2ada562 100644 (file)
function TXMPLoader.Load(Data: Pointer; Len: LongWord; SStreaming: Boolean): Boolean;
var
Err: LongInt;
+ Interp: LongInt;
begin
Result := False;
if xmp_start_player(FXMP, 48000, 0) <> 0 then
raise Exception.Create('xmp_start_player failed');
+ if e_MusicLerp then Interp := XMP_INTERP_LINEAR
+ else Interp := XMP_INTERP_NEAREST;
+ xmp_set_player(FXMP, XMP_PLAYER_INTERP, Interp);
+
FFormat.SampleRate := 48000;
FFormat.SampleBits := 16;
FFormat.Channels := 2;
function TXMPLoader.Load(FName: string; SStreaming: Boolean): Boolean;
var
Err: LongInt;
+ Interp: LongInt;
begin
Result := False;
if xmp_start_player(FXMP, 48000, 0) <> 0 then
raise Exception.Create('xmp_start_player failed');
+ if e_MusicLerp then Interp := XMP_INTERP_LINEAR
+ else Interp := XMP_INTERP_NEAREST;
+ xmp_set_player(FXMP, XMP_PLAYER_INTERP, Interp);
+
FFormat.SampleRate := 48000;
FFormat.SampleBits := 16;
FFormat.Channels := 2;
diff --git a/src/game/g_sound.pas b/src/game/g_sound.pas
index 20ae02e2e53ff8bc1c4378f413e8536e2375da0f..0c18c60d0c813e44e4b9a79865d70699582e8c02 100644 (file)
--- a/src/game/g_sound.pas
+++ b/src/game/g_sound.pas
{$IFDEF USE_OPENAL}
initialization
- {$IF DEFINED(USE_FLUIDSYNTH)}
conRegVar('s_midi_soundfont', @e_SoundFont, 'soundfont to use for midi playback', 'midi soundfont');
- {$ENDIF}
+ conRegVar('s_mod_lerp', @e_MusicLerp, 'interpolate module playback', 'module interpolation');
{$ENDIF}
end.