Forum: Ruby-Gnome 2 SOLVED: gstreamer- linking playbin2

Posted by jake kaiden (lljk)
on 2012-02-17 13:05
hello all,

  quite some time ago i posted a question about linking elements to
gstreamer's playbin2 - http://www.ruby-forum.com/topic/1329197

  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
Posted by Vincent Carmona (vinc-mai)
on 2012-02-17 22:08
(Received via mailing list)
Le 17 fvrier 2012 13:05, jake kaiden <ruby-forum-incoming@andreas-s.net> 
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
> ruby-gnome2-devel-en@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ruby-...
>


Hello Jake.

Thanks for the sample code. I found it usefull.
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.