def run(self): rospy.Subscriber("apex_playground/environment/sound", Float32, self.cb_sound) rospy.spin() self.stream.stop_stream() self.stream.close() self.p.terminate()