#include <gst/gst.h>\r
\r
int main(int argc, char *argv[]) {\r
- GstElement *pipeline, *bin, *equalizer, *sink;\r
+ GstElement *pipeline, *bin, *equalizer, *convert, *sink;\r
GstPad *pad, *ghost_pad;\r
GstBus *bus;\r
GstMessage *msg;\r
\r
/* Create the elements inside the sink bin */\r
equalizer = gst_element_factory_make ("equalizer-3bands", "equalizer");\r
+ convert = gst_element_factory_make ("audioconvert", "convert");\r
sink = gst_element_factory_make ("autoaudiosink", "audio_sink");\r
- if (!equalizer || !sink) {\r
+ if (!equalizer || !convert || !sink) {\r
g_printerr ("Not all elements could be created.\n");\r
return -1;\r
}\r
\r
/* Create the sink bin, add the elements and link them */\r
bin = gst_bin_new ("audio_sink_bin");\r
- gst_bin_add_many (GST_BIN (bin), equalizer, sink, NULL);\r
- gst_element_link (equalizer, sink);\r
+ gst_bin_add_many (GST_BIN (bin), equalizer, convert, sink, NULL);\r
+ gst_element_link_many (equalizer, convert, sink, NULL);\r
pad = gst_element_get_static_pad (equalizer, "sink");\r
ghost_pad = gst_ghost_pad_new ("sink", pad);\r
gst_pad_set_active (ghost_pad, TRUE);\r