audio_visualize_7.py 321 B

12345678910
  1. def update(frames):
  2. if self.stream.is_active():
  3. slice = self.left.get_sample_slice(frames, frames + self.window)
  4. self.stream.write(slice.raw_data)
  5. y = np.array(slice.get_array_of_samples()) / 1000000
  6. # yft = np.abs(np.fft.fft(y)) / self.window
  7. lf.set_ydata(y)
  8. return lf,