v7ilnytskyy Posted October 16, 2020 Posted October 16, 2020 There is description of fftdll.dll on http://heliso.tripod.com/programm/fft/fftdll.htm Please explain me how to use correctly DllCall for call function "spectrum_a_p" from fftdll.dll using $wave[512], $a[512] and $p[512] as parameters. Size of arrays don't matter. May be 1024.
Danyfirex Posted October 18, 2020 Posted October 18, 2020 (edited) Hello. It's easy. Check this example. expandcollapse popup#include <GUIConstantsEx.au3> Example() Func Example() ; Create a GUI with various controls. Local $hGUI = GUICreate("Example", 500, 300) GUISetState(@SW_SHOW, $hGUI) Local $tWave = DllStructCreate("short[1025]") Local $tMid = DllStructCreate("float[1025]") Local $tAmplitude = DllStructCreate("float[1025]") Local $tPhase = DllStructCreate("float[1025]") Local $iFs = 5120 Local $iLen = 1024 Local $iDX = (1.0 / $iFs) Local $iDF = ($iFs / 1024.0) Local $iDT = $iDX For $i = 1 To $iLen Local $t1 = 6.28 * $iDT * $i * 20 DllStructSetData($tWave, 1, (3276 * Sin($t1)), $i) DllStructSetData($tMid, 1, (DllStructGetData($tWave, 1, $i) / 3276.0), $i) Next Local $hFFT = DllOpen("fftdll.dll") DllCall($hFFT, "none", "initDraw", "handle", $hGUI) DllCall($hFFT, "none", "spectrum_a_p", "ptr", DllStructGetPtr($tMid), "ptr", DllStructGetPtr($tAmplitude), "ptr", DllStructGetPtr($tPhase)) DllCall($hFFT, "none", "display", "int", 25, "int", 30, "int", 100, "int", 450, "int", 2, "float", $iDX, "ptr", DllStructGetPtr($tMid), "int", 12, "int", 1, "int", 3, "int", 7) DllCall($hFFT, "none", "display", "int", 25, "int", 150, "int", 100, "int", 450, "int", 1, "float", $iDF, "ptr", DllStructGetPtr($tAmplitude), "int", 12, "int", 1, "int", 3, "int", 7) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE DllClose($hFFT) ExitLoop EndSwitch WEnd ; Delete the previous GUI and all controls. GUIDelete($hGUI) EndFunc ;==>Example pd: I'll update sintaxis highlight later (all around know about my internet issue 🤫) Saludos Edited October 17, 2021 by Danyfirex edited code tag Gianni 1 Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now