Einzelnen Beitrag anzeigen

EWeiss
(Gast)

n/a Beiträge
 
#7

Re: FFT Problem in verbindung mit WMP

  Alt 25. Mai 2007, 06:19
Auch guten Morgen.
Zitat von Klaus01:
Guten Morgen Emil,

In Deinem Array ist der linke Kanal im Index 0 und der rechte Kanal im Index 1, oder?

Grüße
Klaus
Ja.

Zitat:
Ein Stacküberlauf, deutet meines Erachtens eher auf eine sehr lange/endlos Schleife hin.

Hier nochmal die ganze schleife.
Welche eigentlich keinen überlauf verursacht.

Delphi-Quellcode:
      BASS_ChannelGetData(channel, Data32, FFTSize or
                          DWORD(IfThen(ChanInfo.chans = 2,
                          BASS_DATA_FFT_INDIVIDUAL)));


      if (ChanInfo.chans = 2) then
      begin
        for i := 0 to 2047 do
        try
        begin
          if i < 1024 then
          begin
            VisData^.frequency[0, i] :=
                              Max(0, Min(1023, (Trunc(Power(Data32Pos^,
                              FFTSAmplification * 0.8) * 1023))));
              Inc(Data32Pos, FFT_SkipCount);
          end else
          begin
            VisData.frequency[1, i mod 1024]:=
                             Max(0, Min(1023, (Trunc(Power(Data32Pos^,
                             FFTSAmplification * 0.8) * 1023))));
              Inc(Data32Pos, FFT_SkipCount);
          end;
        end;
        except
          Result := false;
          exit;
        end;
      end
      else
      begin
        for i := 0 to 1023 do
        begin
          VisData^.frequency[0, i] :=
            Max(0, Min(1023, (Trunc(Power(Data32Pos^, FFTSAmplification * 1.0) * 1023))));
          VisData^.frequency[1, i] := VisData^.frequency[0, i];
          Inc(Data32Pos, FFT_SkipCount);
        end;
      end;
Der fehler tritt bei mehr als 1023 auf .

Hier mal die Definition von BASS_DATA_FFT_INDIVIDUAL

Zitat:
BASS_DATA_FFT_INDIVIDUAL Use this flag to request separate FFT data for each channel. The size of the data returned is multiplied by the number channels.

-> So stereo will return 2 times the data requested (left and right = 2 channels).
-> So you will get both channels data with one single request.
gruss Emil
  Mit Zitat antworten Zitat