Thema: Delphi GetChannelsPeakValues

Einzelnen Beitrag anzeigen

DaCoda

Registriert seit: 21. Jul 2006
Ort: Hamburg
145 Beiträge
 
Delphi 12 Athens
 
#3

AW: GetChannelsPeakValues

  Alt 19. Mai 2024, 11:54
Thank you for your Answer,

I have made a modification in the procedure:
Code:
procedure TfrmMain.Timer100msTimer(Sender: TObject);
var
  ChannelCount: UInt;
  PeakLevels: array[0..1] of Single;
  poPeakLevels: PSingle;

  procedure ClearPeakLevels;
  begin
    PeakLevels[0] := MinProzentValue;
    PeakLevels[1] := MinProzentValue;
  end;

begin
  ClearPeakLevels;
  Peak.GetMeteringChannelCount(ChannelCount);
  if (ChannelCount = 2) then begin
    poPeakLevels := pSingle(@PeakLevels[0]);
    if Succeeded(Peak. GetChannelsPeakValues(ChannelCount, poPeakLevels)) then begin
      VuMeterL.Position := Round(PeakLevels[0] * MaxProzentValue);
      VuMeterR.Position := Round(PeakLevels[1] * MaxProzentValue);
    end else begin
      ClearPeakLevels;
    end;
  end else begin
    if Succeeded(Peak.GetPeakValue(PeakLevels[0])) then begin
      VuMeterL.Position := Round(PeakLevels[0] * MaxProzentValue);
      VuMeterR.Position := VuMeterL.Position;
    end else begin
      ClearPeakLevels;
    end;
  end;
end;
Now i have no errors, but the PeakValues are everytime 0.0
The Rsult from Peak.GetPeakValues = S_Ok
Now i have no Idea was is wrong...
Debuggers don’t remove bugs, they only show them in slow-motion.
  Mit Zitat antworten Zitat