Page 1 of 1

Using libVLC to analyze audio data for silence detection and replay gain

Posted: 07 Sep 2017 03:47
by JayShoe2
I have libVLC integrated into a Visual C project and we are playing files fine. We are looking to obtain the replay gain values, and detect silence in the files we are playing. Does anyone have any information about how this could be accomplished in theory if we wrote our own analysis code?

VLC has visualizations. I might be wrong but if the software can create visualizations from the track data, it could theoretically create a data table that could then be analyzed. So I suppose the key would be to write some type of visualization that wouldn't be focused on visuals, but rather collecting that same data on a file. There is a "stream to memory" function inside libVLC - I'm not sure if that would help with this so we could play the file faster than regular speed (fast scan).

For Replaygain, we would write down the dB values throughout the track and then calculate the averages, peeks, etc. For silence detection, we would find the first frame of the file that had audio > x dB, the last frame of the file that had audio > x dB. Then we would save the replay value, and the silence detection start/stop points. Using this data we would tell our player to start and stop and the calculated points, and utilize the replay gain value (already inside of libVLC currently, when values are supplied).

We want to use VLC over other playback code because it works so well at playing whatever is thrown at it... If anyone had any information about how this could be accomplished with libVLC, I would appreciate the info! Thanks for the help!

Re: Using libVLC to analyze audio data for silence detection and replay gain

Posted: 16 Oct 2017 05:55
by Jean-Baptiste Kempf
So, either you use a "visualisation in memory" module that you would write, or you use the audio output in memory as callback in libvlc (libvlc_audio_set_callbacks)

Re: Using libVLC to analyze audio data for silence detection and replay gain

Posted: 10 Dec 2018 16:18
by JayShoe2
I wonder if integrating something like "Aubio" would help.
https://aubio.org/

Or SoundTouch which is used in many other noteworthy apps.
http://www.surina.net/soundtouch/