Autor Beitrag
pascalsv
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 133

Win XP Prof. SP2 / Windows 7
Visual Studio 2008 / Silverlight 3 / Silverlight 4 Beta
BeitragVerfasst: Fr 13.10.06 10:44 
Hallo zusammen,

nach Vorbild der Bass-Demo Sample_Vis will ich eine Spektrumanzeige in meinen Player einfügen. Dabei erhalte ich die Fehlermeldung "Ungültige Gleitkommaoperation".

Ich erstelle den Bass-Stream mit
ausblenden Delphi-Quelltext
1:
Channel := BASS_StreamCreateFile(False, PChar(aPlayArray[2].Path), 0, 0, 0);					


Beim Auselesen des FFTFata im Spectrum.Draw tritt der Fehler auf.

ausblenden Delphi-Quelltext
1:
2:
BASS_ChannelGetData(Channel, @FFTFata, BASS_DATA_FFT1024);
  Spectrum.Draw (PaintFrame.Canvas.Handle, FFTFata, TrackX.Position - 40, TrackY.Position - 60);


Schaue ich mir den Inhalt des FFTFata im Vergleich zur Demo Sample_Vis an, enthält es viel zu grosse Gleitkommazahlen (3.23342442e-44 z.B.) bei mir, lauter Nullen im Demofall. Dies verstehe ich nicht. FFTFata wird in der Common_Types in beiden Fällen als Type TFFTData  = array [0..512] of Single; deklariert.

Zudem enthält FFTFata in manchen Zellen "-NAN" oder "+NAN". Das ist doch nicht normal??

Komische Kiste??? :roll:

Danke!
alias5000
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2145

WinXP Prof SP2, Ubuntu 9.04
C/C++(Code::Blocks, VS.NET),A51(Keil),Object Pascal(D2005PE, Turbo Delphi Explorer) C# (VS 2008 Express)
BeitragVerfasst: Fr 13.10.06 11:31 
Die oben genannte Zahl ist absolut total klein!

3,2...hoch -44, also 0,0000000...(um 44 Stellen nach rechts verschoben)....0000032

Geh mal die entsprechende Stelle im Einzelschritt mit F7 durch und sag mal, wo es den Fehler genau gibt.

Gruß alias5000

_________________
Programmers never die, they just GOSUB without RETURN
pascalsv Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 133

Win XP Prof. SP2 / Windows 7
Visual Studio 2008 / Silverlight 3 / Silverlight 4 Beta
BeitragVerfasst: Fr 13.10.06 11:34 
Richtig, da aber auch Zahlen wie 3.45435345e+36 vorkommen, sagte ich "zu gross"...

Der Fehler passiert in der Zeile
ausblenden Delphi-Quelltext
1:
YPos := Trunc((YVal) * 500);					


in der TSpectrum.Draw Methode.

Danke!
alias5000
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2145

WinXP Prof SP2, Ubuntu 9.04
C/C++(Code::Blocks, VS.NET),A51(Keil),Object Pascal(D2005PE, Turbo Delphi Explorer) C# (VS 2008 Express)
BeitragVerfasst: Fr 13.10.06 11:42 
hm, iss so schwer zu sagen, woran das liegen könnte. Könntest du bitte mal dein Projekt hier hochstellen? Es muss irgendeinen (fehlerhaften) Unterschied in der Ansteuerung dieser Klasse geben.

Gruß alias5000

_________________
Programmers never die, they just GOSUB without RETURN
pascalsv Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 133

Win XP Prof. SP2 / Windows 7
Visual Studio 2008 / Silverlight 3 / Silverlight 4 Beta
BeitragVerfasst: Fr 13.10.06 13:33 
Moinsen,

danke für die Hilfe. Ich habe den Fehler gefunden. Zu dem Zeitpunkt, wo ich FFTFAta auslese, spielt mein Bass noch gar nichts. Daher konnte es auch nicht gehen...

:oops:

Pascal