Use global variables for ListenThread and CaptureThread