I want to detect peak and rms value of particular audio files (format can be .opus, .wav etc., or it can be input from mic as well without recording a voice). Using GStreamer's good 'level' plugin I can achieve this.
I tried the sample provided here, level_plugin_example
I also tried command line example,
$ gst-launch-1.0 -v -m audiotestsrc ! audioconvert ! audio/x-raw,format=S8,channels=2 ! level ! fakesink silent=TRUE
OR
$ gst-launch-1.0 -v -m audiotestsrc ! volume volume=1.0 ! level ! fakesink silent=TRUE
these are giving null rms and peak values.
By going through these examples, I got to know how to use level. But question is, in the example they have used caps to set raw media (Is there anything done internally to get output of level plugin?) but I want user defined media input so how to achieve this?
Summary: I want a sample code snippet of 'level' plugin which takes an input as a recorded audio or live audio file and detect its rms and peak values.
The "level" element sends messages. Usage example may be found on the link (gstreamer examples): https://github.com/krad-radio/gstreamer-plugins-good-krad/blob/master/tests/examples/level/level-example.c