Thema: Delphi GetChannelsPeakValues

Einzelnen Beitrag anzeigen

Kas Ob.

Registriert seit: 3. Sep 2023
346 Beiträge
 
#5

AW: GetChannelsPeakValues

  Alt 19. Mai 2024, 12:25
Glad it did help !

Just few points :
1) No need to ClearPeakLevels, they will be overwritten if the GetPeakValue was success.
2) By using timer you are losing too much volume calculations and it will not be so accurate, it is better to capture the sound and only then assuming you are capturing 1/20 or 1/50 (preferably) in a second then on that event (or callback) get the peak volume hence you will have exactly the same values you in Sound Control Panel. (you can replicate the same volume the system show , pointed in a screenshot)
3) you can use absolute and make it cleaner
Code:
var
  ChannelCount: UInt;
  PeakLevels: array[0..1] of Single;
  pPeakLevels: PSingle absolute PeakLevels;

2024-05-19-13_08_52-neffex-anxiety-lyrics-youtube.png
Kas
  Mit Zitat antworten Zitat