We have already developed code for playing an audio. Let's now tweak the method AudioPlayer.constructPipeline
to build the gst.Pipeline
using different element objects.
Rewrite the
constructPipeline
method as follows. You can also download the filePlayingAudio.py
from the Packt website for reference. This file has all the code we discussed in this and previous sections.1 def constructPipeline(self): 2 self.player = gst.Pipeline() 3 self.filesrc = gst.element_factory_make("filesrc") 4 self.filesrc.set_property("location", 5 "C:/AudioFiles/my_music.mp3") 6 7 self.decodebin = gst.element_factory_make("decodebin", 8 "decodebin") 9 # Connect decodebin signal with a method. 10 # You can move this call to self.connectSignals) 11 self.decodebin.connect("pad_added", 12 self.decodebin_pad_added) 13 14 self.audioconvert = \ 15 gst.element_factory_make("audioconvert", 16 "audioconvert...