AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Multimedia Delphi GetChannelsPeakValues
Thema durchsuchen
Ansicht
Themen-Optionen

GetChannelsPeakValues

Ein Thema von DaCoda · begonnen am 18. Mai 2024 · letzter Beitrag vom 19. Mai 2024
Antwort Antwort
DaCoda

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

AW: GetChannelsPeakValues

  Alt 19. Mai 2024, 11:10
Nun ist der Groschen gefallen

So hat es dann geklappt:
Code:
if Succeeded(Peak. GetChannelsPeakValues(ChannelCount, pSingle(PeakLevels))) then begin
  VuMeterL.Position := Round(PeakLevels[0] * MaxProzentValue);
  VuMeterR.Position := Round(PeakLevels[1] * MaxProzentValue);
end
Vielen Dank Kas Ob.
Debuggers don’t remove bugs, they only show them in slow-motion.
  Mit Zitat antworten Zitat
Kas Ob.

Registriert seit: 3. Sep 2023
390 Beiträge
 
#2

AW: GetChannelsPeakValues

  Alt 19. Mai 2024, 11: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
DaCoda

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

AW: GetChannelsPeakValues

  Alt 19. Mai 2024, 11:56
@Kas Ob.

Thank you, i have made your suggestions. And it works perfect!
Debuggers don’t remove bugs, they only show them in slow-motion.
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 16:19 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz