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

This forum is about all development around libVLC.
JayShoe2
New Cone
New Cone
Posts: 4
Joined: 06 Jul 2017 02:09

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

Postby JayShoe2 » 07 Sep 2017 03:47

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!

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

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

Postby Jean-Baptiste Kempf » 16 Oct 2017 05:55

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)
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

JayShoe2
New Cone
New Cone
Posts: 4
Joined: 06 Jul 2017 02:09

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

Postby JayShoe2 » 10 Dec 2018 16:18

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/


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 8 guests