![]() |
FModEx - Problem mit Fmod_System_GetSpectrum
Hi,
ich habe ein kleines Problem mit FModEx: Ich habe mit den Funktionen etwas rumgespielt, und bei diesem Code (folgt) bekam ich Access Violations:
Delphi-Quellcode:
Aus den CPP-Beispielen weiß ich, das f eigentlich eine Art Array sein Müsste, aber in den API-Units für Delphi ist da bloss ein single.
procedure TForm1.Button1Click(sender: TObject);
var f: single; begin FMOD_System_GetSpectrum(Engine,f,64,0,FMOD_DSP_FFT_WINDOW_TRIANGLE); Label1.Caption:=FloatToStr(f); end; Die Access Violations treten in der fmodex.dll selbst auf, nicht in meinem Programm. Auch die Funktion PluginInfo liefert diesen Fehler. Weiß jemand Rat, eventuell sogar ein Tutorial dafür? |
Re: FModEx - Problem mit Fmod_System_GetSpectrum
Hi.
Ist schon irgendwie klar, dass die AV im library code passiert - du hast beim Aufruf gesagt, dass du 64 Werte im array bereit stellst, wobei die Adresse des ersten Wertes übergeben wird. Der C Code in der library hangelt sich dann durch Zeiger Arithmetik durch das array.
Delphi-Quellcode:
Grüße vom marabu
var
f: array of Single; begin SetLength(f, 64); // ... load array FMOD_System_GetSpectrum(Engine, f[0], 64, 0, FMOD_DSP_FFT_WINDOW_TRIANGLE); // ... show array end; |
Re: FModEx - Problem mit Fmod_System_GetSpectrum
Hat geklappt.
Danke. |
Re: FModEx - Problem mit Fmod_System_GetSpectrum
Auch wenn du dich schon vor Monaten angemeldet hast - du bist herzlich willkommen in der Delphi-PRAXiS.
Freundliche Grüße marabu |
Alle Zeitangaben in WEZ +1. Es ist jetzt 02:42 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz