def update(frames): if self.stream.is_active(): slice = self.left.get_sample_slice(frames, frames + self.window) self.stream.write(slice.raw_data) z = np.array(slice.get_array_of_samples()) zft = np.abs(np.fft.fft(z / max(z))) / (self.window * 4) lf.set_xdata(x) lf.set_ydata(y) lf.set_3d_properties(zft) lf2.set_xdata(x) lf2.set_ydata(y) lf2.set_3d_properties(z / 1000000) return lf, lf2,