So if I have the bus receiving messages from spectrum, would i get the "magnitude" of the FFT with message->get_structure()->get_field("magnitude", mags_by_ref)?
Thanks! On Wed, Apr 13, 2016 at 7:30 PM, Marcin Kolny <marcin.ko...@gmail.com> wrote: > > > 2016-04-14 1:09 GMT+02:00 Cole Bush <bus...@husky.neu.edu>: > >> Hello, >> >> I am creating a gstreamermm pipeline that uses the "good" spectrum >> <https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-good-plugins/html/gst-plugins-good-plugins-spectrum.html> >> plugin >> to perform a fft on the audio. I think I have the pipeline working >> correctly (it plays the file) and I am recieving messages on the bus, but I >> don't know how to get the information from it. Firstly, is this the correct >> way to initialize it? >> >> Glib::RefPtr<Element> spectrum; >> spectrum = ElementFactory::create_element("spectrum"); >> spectrum->property("post-messages", true); >> spectrum->property("bands", 20); >> spectrum->property("threshold", -80); >> >> Should it be a RefPtr to an Element or AudioFilter? >> > It can be either Element or AudioFilter. As long as you don't need any > AudioFilter-specific feature, you can use Element class. > > >> >> Second, in my bus message listener I have a case for a message type of >> Gst::MESSAGE_ELEMENT which then calls a function to get the info: >> "decode_spectrum(const RefPtr<Message> &message);" How do I get info like >> the name (should be "spectrum") >> > Since you didn't specify element name in your code, it'll be autogenerated > and you can get the name by calling: > spectrum->get_name(); > If you want to explicitly specify the name, you should use method: > https://developer.gnome.org/gstreamermm/stable/classGst_1_1ElementFactory.html#a6a85a2a3c4f69383cad2686d381e10e9 > > >> and the data (magnitude in dB)? >> > You'd have to use Gst::Structure::get_field() method. > >> >> >> Thanks for any insight! >> >> _______________________________________________ >> gtkmm-list mailing list >> gtkmm-list@gnome.org >> https://mail.gnome.org/mailman/listinfo/gtkmm-list >> >> > > > -- > Best regards, > Marcin Kolny >
_______________________________________________ gtkmm-list mailing list gtkmm-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtkmm-list