class_docstr: Opus encoder based on Gstreamer
class_docstr_tok: ["Opus","encoder","based","on","Gstreamer"]
code: def setup(
      self,
      channels=None,
      samplerate=None,
      blocksize=None,
      totalframes=None,
  ):
      super(OpusEncoder, self).setup(
          channels, samplerate, blocksize, totalframes
      )
  
      self.pipe = """appsrc name=src
                    ! audioconvert ! audioresample
                    ! opusenc bitrate=128000
                    ! oggmux
                    """
  
      if self.filename and self.streaming:
          self.pipe += (
              """ ! tee name=t
              ! queue ! filesink location=%s
              t. ! queue! appsink name=app sync=False
              """
              % self.filename
          )
  
      elif self.filename:
          self.pipe += (
              "! filesink location=%s async=False sync=False "
              % self.filename
          )
      else:
          self.pipe += "! queue ! appsink name=app sync=False"
  
      self.start_pipeline(channels, samplerate)
  
file_path: TimeSide/timeside/plugins/encoder/opus.py
imports: from timeside.core import implements, interfacedoc
  from timeside.core.encoder import GstEncoder
  from timeside.core.api import IEncoder
label_desc: Use image node_id 1 for calling the OpusEncoder obj's underlying member method code with example usage: obj.setup(channels, samplerate, blocksize, totalframes) without return types