code: def __init__(self):
      # pyqtgraph stuff
      pg.setConfigOptions(antialias=True)
      self.traces = dict()
      self.app = QtGui.QApplication(sys.argv)
      self.win = pg.GraphicsWindow(title="Spectrum Analyzer")
      self.win.setWindowTitle("Spectrum Analyzer")
      self.win.setGeometry(5, 115, 1910, 1070)
  
      wf_xlabels = [(0, "0"), (2048, "2048"), (4096, "4096")]
      wf_xaxis = pg.AxisItem(orientation="bottom")
      wf_xaxis.setTicks([wf_xlabels])
  
      wf_ylabels = [(0, "0"), (127, "128"), (255, "255")]
      wf_yaxis = pg.AxisItem(orientation="left")
      wf_yaxis.setTicks([wf_ylabels])
  
      sp_xlabels = [
          (np.log10(10), "10"),
          (np.log10(100), "100"),
          (np.log10(1000), "1000"),
          (np.log10(22050), "22050"),
      ]
      sp_xaxis = pg.AxisItem(orientation="bottom")
      sp_xaxis.setTicks([sp_xlabels])
  
      self.waveform = self.win.addPlot(
          title="WAVEFORM",
          row=1,
          col=1,
          axisItems={"bottom": wf_xaxis, "left": wf_yaxis},
      )
      self.spectrum = self.win.addPlot(
          title="SPECTRUM",
          row=2,
          col=1,
          axisItems={"bottom": sp_xaxis},
      )
  
      # pyaudio stuff
      self.FORMAT = pyaudio.paInt16
      self.CHANNELS = 1
      self.RATE = 44100
      self.CHUNK = 1024 * 2
  
      self.p = pyaudio.PyAudio()
      self.stream = self.p.open(
          format=self.FORMAT,
          channels=self.CHANNELS,
          rate=self.RATE,
          input=True,
          output=True,
          frames_per_buffer=self.CHUNK,
      )
      # waveform and spectrum x points
      self.x = np.arange(0, 2 * self.CHUNK, 2)
      self.f = np.linspace(0, self.RATE / 2, self.CHUNK / 2)
  
file_path: audio-spectrum-analyzer/audio_spectrumQT.py
imports: import numpy
  from pyqtgraph.Qt import QtGui, QtCore
  import pyqtgraph
  import struct
  import pyaudio
  from scipy.fftpack import fft
  import sys
  import time
label_desc: Use image node_id 1 to create a new AudioStream object from inherited base classes: object with example: obj = AudioStream()