Let's add fade-out effect to an input audio. We will use the same source file as used in the Adjusting volume section.
If you haven't already, download the file
AudioEffects.py
that has the source code for this example.In the
__init__
method of this class, you will need to do one small change. Set the flagself.fade_example
toTrue
so that it now runs the code that adds fade-out effect.We already reviewed the
self.constructPipeline()
method in Adjusting volume section. It calls the methodself.setupVolumeControl()
.1 def setupVolumeControl(self): 2 self.volumeControl = gst.Controller(self.volume, 3 "volume") 4 self.volumeControl.set("volume", 0.0*gst.SECOND, 5 self.volumeLevel) 6 self.volumeControl.set_interpolation_mode("volume", 7 gst.INTERPOLATE_LINEAR)
The GStreamer
Controller
object is created on line 2. It is a light-weight object that provides...