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;
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;
{$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.