SuRGeoNix / Flyleaf

Media Player .NET Library for WinUI 3/ WPF/WinForms (based on FFmpeg/DirectX)
GNU Lesser General Public License v3.0
713 stars 101 forks source link

Audio levels for vu-meters #314

Closed jeroenm2 closed 1 year ago

jeroenm2 commented 1 year ago

Hi, is there a possibility to get audio level values for usage in vu-meters. I was looking into the audio frame that should hold that data I suppose. But I couldn't figure it out myself. Do you know if it is possible or if it something that has to be added on your side?

SuRGeoNix commented 1 year ago

Hi @jeroenm2, you can read the audio frame from Player.Audio.SamplesAdded event and analyze it in the way that you want. The format is always stereo (2 channels) - 16bits and the sample rate currently is the same as the input so you can read it from Player.Audio.SampleRate.

jeroenm2 commented 1 year ago

Hi @SuRGeoNix, I was in the right direction. Thanks, that helped a lot