audio_visualize_4.py 338 B

123456789101112
  1. def music_visualize_1d(self):
  2. fig = plt.figure(facecolor='black')
  3. ax = fig.gca()
  4. norm = plt.Normalize(-1., 1.)
  5. lc = LineCollection([], cmap='cool', norm=norm)
  6. ax.set_ylim(-1.5, 1.5)
  7. ax.set_axis_off()
  8. time = np.linspace(0, 2 * np.pi, self.window)
  9. ax.add_collection(lc)
  10. plt.pause(self.record_delay)