From 20e4bf0b046d13bf32acd64fd378c61acc636a25 Mon Sep 17 00:00:00 2001 From: oparviai Date: Sun, 26 Nov 2017 09:10:41 +0000 Subject: [PATCH] Added BPM functions to Pascal interface of SoundTouch DLL --- source/SoundTouchDLL/SoundTouchDLL.pas | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/source/SoundTouchDLL/SoundTouchDLL.pas b/source/SoundTouchDLL/SoundTouchDLL.pas index 24d27d6..c3e9dcc 100644 --- a/source/SoundTouchDLL/SoundTouchDLL.pas +++ b/source/SoundTouchDLL/SoundTouchDLL.pas @@ -423,6 +423,13 @@ var SoundTouchLibHandle: HINST; SoundTouchDLLFile: PAnsiChar = 'SoundTouch.dll'; + // bpm detect functions. untested -- if these don't work then remove: + bpm_createInstance: function(chan: CInt32; sampleRate : CInt32): THandle; cdecl; + bpm_destroyInstance: procedure(h: THandle); cdecl; + bpm_getBpm: function(h: THandle): cfloat; cdecl; + bpm_putSamples: procedure(h: THandle; const samples: pcfloat; + numSamples: cardinal); cdecl; + procedure InitDLL; begin SoundTouchLibHandle := LoadLibrary(SoundTouchDLLFile); @@ -454,6 +461,11 @@ begin Pointer(SoundTouchNumSamples) := GetProcAddress(SoundTouchLibHandle, 'soundtouch_numSamples'); Pointer(SoundTouchIsEmpty) := GetProcAddress(SoundTouchLibHandle, 'soundtouch_isEmpty'); + Pointer(bpm_createInstance) :=GetProcAddress(SoundTouchLibHandle, 'bpm_createInstance'); + Pointer(bpm_destroyInstance) :=GetProcAddress(SoundTouchLibHandle, 'bpm_destroyInstance'); + Pointer(bpm_getBpm) :=GetProcAddress(SoundTouchLibHandle, 'bpm_getBpm'); + Pointer(bpm_putSamples) :=GetProcAddress(SoundTouchLibHandle, 'bpm_putSamples'); + except FreeLibrary(SoundTouchLibHandle); SoundTouchLibHandle := 0;