Page 1 of 1

AudioCallback Calculate audio level

Posted: 01 Oct 2023 14:43
by madrianR
Hello,

I'm using LibVLCSharp MediaPlayer to shiw RSTP Media Stream - all works fine but now I need to show a audio level meter. I know that
I can use AudioCallback but do not now how to calculate the level...

_mediaPlayer.SetAudioFormatCallback(AudioSetup, AudioCleanup);
_mediaPlayer?.SetAudioCallbacks(AudioCallback, PauseAudio, ResumeAudio, FlushAudio, DrainAudio);

void AudioCallback(IntPtr data, IntPtr samples, uint count, long pts)
{
...?
}


anybody out there whow can help me?

robert

Re: AudioCallback Calculate audio level

Posted: 01 Oct 2023 18:58
by RĂ©mi Denis-Courmont
You have the audio samples in the format that you requested. How to measure depends what you want to measure. If you don't know, nobody else will.

Also this forum is about LibVLC, not mathematics, TBH.

Re: AudioCallback Calculate audio level

Posted: 19 Oct 2023 00:55
by arunp
I am facing issue in audiobargraph in c#
"--audio-filter=audiobargraph_a","--audiobargraph_a-bargraph=1","--sub-source=audiobargraph_v"
using above options but no audio bar graph is displayed
Just i can see the axis but not audio level bar graph