SOLVED: gstreamer- linking playbin2

hello all,

quite some time ago i posted a question about linking elements to
gstreamer’s playbin2 - Gstreamer: linking playbin2 - Ruby-Gnome 2 - Ruby-Forum

after shelving it for a long time, i started fooling around with it
again the other day and managed to figure out how to link playbin2 to
the equalizer plugin. i thought i’d share it here as we couldn’t come
up with any answers last time around…

the basics are like this:

@pipeline = Gst::ElementFactory.make(“playbin2”)
audio = “test.mp3” ## MODIFY THIS
@pipeline.uri= GLib.filename_to_uri(audio)

bin = Gst::Bin.new()
@eq = Gst::ElementFactory.make(“equalizer-10bands”)
autosink = Gst::ElementFactory.make(“autoaudiosink”)

bin.add(@eq)
bin.add(autosink)
@eq >> autosink

eqpad = @eq.get_pad(“sink”)
gpad = Gst::GhostPad.new(“gpad”, eqpad)
bin.add_pad(gpad)

@pipeline.audio_sink = bin

@pipeline.play

then, in the gui you do a bunch of sliders like this one:

slider0 = Gtk::VScale.new(-24, 12, 1)
slider0.inverted = true
slider0.set_size_request(20,200)
slider0.set_value(@eq.band0)
slider0.signal_connect(“value-changed”){@eq.band0 =(slider0.value)}

…and it works - finally!

  • j

Le 17 fvrier 2012 13:05, jake kaiden [email protected]
a
crit :

the basics are like this:
bin.add(autosink)
then, in the gui you do a bunch of sliders like this one:

ruby-gnome2-devel-en mailing list
[email protected]
ruby-gnome2-devel-en List Signup and Options

Hello Jake.

Thanks for the sample code. I found it usefull.