Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Multimedia (https://www.delphipraxis.net/16-multimedia/)
-   -   Delphi FModEx - Problem mit Fmod_System_GetSpectrum (https://www.delphipraxis.net/61570-fmodex-problem-mit-fmod_system_getspectrum.html)

bizzl 23. Jan 2006 11:48


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:
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;
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.
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?

marabu 23. Jan 2006 12:35

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:
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;
Grüße vom marabu

bizzl 26. Jan 2006 11:03

Re: FModEx - Problem mit Fmod_System_GetSpectrum
 
Hat geklappt.
Danke.

marabu 26. Jan 2006 11:13

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 14:45 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz