[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to implement an audio-filter for the GStreamer playbin - element?


Am 17.02.26 um 18:05 schrieb Claus Dietrich:
Hi
I am trying to build a special AudioPlayer-class for someone in the German Club, who wants to play audio files with a normalized volume.
I drafted the following GStreamer pipeline, which should do the job:

$ gst-launch-1.0 playbin volume=0.5 audio-filter="audioamplify amplification=1" uri="file:///home/claus/song.mp3"

Unfortunately I failed to mimic this pipeline with gb.media.

This part works

  pl = New MediaPipeline As "PipeEvents"
  src = New MediaControl(pl, "playbin")
  src["volume"] = 0.5
  src["uri"] = "file:///home/claus/song.mp3"
  pl.play()

but I don't know how to implement the audio-filter with Gambas. Do I have to use the MediaFilter-class? If so, how do I have to set it up and how can I use it as for the playbin-property audio-filter? All attempts failed so far.

Can someone help?

I concluded, that this type of GStreamer element-property is not supported by Gambas. Any other statement or confirmation would be very welcome.

As a workaround I drafted a pipeline with the GStreamer plugin decodebin, which allows to use audioamplify as a usual element within a Gambas MediaPipeline.

  'Generate the pipeline
  pl = New MediaPipeline As "PipeEvents"

  'Generate the pipeline elements
  src = New MediaControl(pl, "filesrc")
  src["location"] = sPath
  dcb = New MediaControl(pl, "decodebin")
  cnv = New MediaControl(pl, "audioconvert")
  rgv = New MediaControl(pl, "audioamplify")
  rgv["amplification"] = 1
  rsp = New MediaControl(pl, "audioresample")
  snk = New MediaControl(pl, "autoaudiosink")

  'Link the elements
  src.LinkTo(dcb)
  dcb.LinkLaterTo(cnv)
  cnv.Linkto(rgv)
  rgv.Linkto(rsp)
  rsp.LinkTo(snk)

Best regards

Claus






References:
How to implement an audio-filter for the GStreamer playbin - element?Claus Dietrich <claus.dietrich@xxxxxxxxxx>