code: def run(self):
      pipeline = Gst.Pipeline("pipeline")
      mainloop = GLib.MainLoop()
  
      numpy_src = NumpySrc(
          array=self.sample_array.array, samplerate=self.samplerate
      )
  
      converter = Gst.ElementFactory.make("audioconvert", "converter")
  
      encoder_muxer = []
      for enc in self.gst_audio_encoder:
          encoder_muxer.append(Gst.ElementFactory.make(enc))
  
      filesink = Gst.ElementFactory.make("filesink", "sink")
      filesink.set_property("location", self.output_file)
  
      pipe_elements = [numpy_src.appsrc, converter]
      pipe_elements.extend(encoder_muxer)
      pipe_elements.append(filesink)
  
      pipeline.add(*pipe_elements)
      # Gst.Element.link_many(*pipe_elements)
      numpy_src.appsrc.link(converter)
      converter.link(encoder_muxer[0])
      while len(encoder_muxer) > 1:
          next_el = encoder_muxer.pop(0)
          next_el.link(encoder_muxer[0])
      encoder_muxer[0].link(filesink)
  
      def on_eos(bus, msg):
          pipeline.set_state(Gst.State.NULL)
          mainloop.quit()
  
      def on_error(bus, msg):
          err, debug_info = msg.parse_error()
          print(
              "Error received from element %s: %s"
              % (msg.src.get_name(), err)
          )
          print("Debugging information: %s" % debug_info)
          mainloop.quit()
  
      pipeline.set_state(Gst.State.PLAYING)
      bus = pipeline.get_bus()
      bus.add_signal_watch()
      bus.connect("message::eos", on_eos)
      bus.connect("message::error", on_error)
  
      mainloop.run()
  
imports: from __future__ import division
  import gi
  from gi.repository import GLib, Gst
  import numpy
  import scipy.signal.waveforms
  import os.path
  import ffmpeg
label_desc: Use image node_id 2 for calling the gst_BuildSample obj's underlying member method code with example usage: obj.run() without return types