How to set a volume property in audiomixer's sink pads?
Michael Gruner
michael.gruner at ridgerun.com
Thu Jun 2 03:27:53 UTC 2016
Hi Natanael
The audio mixer pads expose properties as objects they are. Let am_pad0, am_pad1, …, am_padN be the N pads of the audio mixer, then you can set their properties as:
Mute all sources except am_pad0:
g_object_set (am_pad0, “mute”, FALSE, NULL);
g_object_set (am_pad1, “mute”, TRUE, NULL);
...
g_object_set (am_padN, “mute”, TRUE, NULL);
Change volume of pads:
g_object_set (am_pad0, “volume”, 5.0, NULL);
g_object_set (am_pad1, “volume”, 1.0, NULL);
...
g_object_set (am_padN, “volume”, 10.0, NULL);
Refer to the video mixer’s documentation for more info:
https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-bad-plugins/html/gst-plugins-bad-plugins-audiomixer.html <https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-bad-plugins/html/gst-plugins-bad-plugins-audiomixer.html>
—
Michael Gruner <michael.gruner at ridgerun.com <mailto:michael.gruner at ridgerun.com>>
Embedded Linux and GStreamer solutions
RidgeRun Engineering
Contact Us - http://www.ridgerun.com/#!contact/c3vn <http://www.ridgerun.com/#!contact/c3vn>
> On Jun 1, 2016, at 17:59, Natanael Mojica <neithanmo at gmail.com> wrote:
>
> Hi:
>
> I have a audiomixer element in my pipeline, and others elements linked into that
> but now I want to change de volume of any audiosource connected to a audiomixer
>
> gst_bin_add(GST_BIN(pipeline), source->get_bin());
> GstPad *mixer_pad = gst_element_request_pad (audiomixer, mix_template, NULL, NULL);
> GstPad *a_pad = gst_element_get_static_pad(source->get_bin(), "audiosrc");
> if (gst_pad_link (a_pad, mixer_pad) != GST_PAD_LINK_OK ){
> g_critical ("link audio source to audiomixer failed.\n");
> exit(1);
> }
>
> for example
>
> filesrc -> decodbin -> queue -> audiomixer (sink0)
>
> filesrc2 ..... -> audiomixer(sink1)
> ....
> ....
> ... -> audiomixer (sinkn)
> My question is , how to set mute all sink less sink2 o sink3 , or set a volume property in 4 of the sink2 pad
>
> thanks
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20160601/1bb0e11b/attachment.html>
More information about the gstreamer-devel
mailing list