title: Store audio from QAudioInput and pass it to SciPy FFT
body: <p>how can I get audio input in real time from QAudioInput, store it in a NumPy array and pass it to SciPy FFT? What I have tried:</p>
  <pre><code>from PyQt5.QtMultimedia import QAudioDeviceInfo, QAudioFormat, QAudioInput
  import sys
  
  class Window(QMainWindow):
      def __init__(self):
          info = QAudioDeviceInfo()
          input_device = info.defaultInputDevice()
          if input_device.isNull():
              # If no avaiable device is found, we display a error
              print(&quot;There is no audio input device available.&quot;)
              exit(-1)
  
          audio_format = QAudioFormat()
          audio_format.setSampleRate(44100)
          audio_format.setSampleSize(8)
          audio_format.setChannelCount(1)
          audio_format.setCodec(&quot;audio/pcm&quot;)
          audio_format.setSampleType(QAudioFormat.UnSignedInt)
  
          if sys.byteorder == &quot;little&quot;:
              audio_format.setByteOrder(QAudioFormat.LittleEndian)
          else:
              audio_format.setByteOrder(QAudioFormat.BigEndian)
          self.audioInput = QAudioInput(input_device, audio_format, self)
          self.ioDevice = self.audioInput.start()
          self.ioDevice.readyRead.connect(self.read_audio)
  
      def read_audio(self):
          data: QByteArray = self.ioDevice.readAll()
          print(data.toUInt()) # Prints (0, False) which means error converting data
  </code></pre>