From e8a0cd1b7b3dea3cb9653d6630eebbc5dd7c19bd Mon Sep 17 00:00:00 2001 From: Ivan Maslov Date: Sat, 8 Oct 2022 23:02:03 +0300 Subject: [PATCH] Audio fixes in threads --- Sources/pyOpenRPA/Robot/Audio.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Sources/pyOpenRPA/Robot/Audio.py b/Sources/pyOpenRPA/Robot/Audio.py index a00b5d43..f532df25 100644 --- a/Sources/pyOpenRPA/Robot/Audio.py +++ b/Sources/pyOpenRPA/Robot/Audio.py @@ -202,7 +202,7 @@ class Recorder: frames_per_buffer = self.mFramesInt, input_device_index = lDeviceInfoDict["index"], as_loopback = not self.mIsMicrophoneBool) - self.mCaptureThread = threading.Thread(target=self.__Capture__) + self.mCaptureThread = threading.Thread(target=self.__Capture__, daemon = True) self.mStartSecFloat = time.time() self.mStartChunkSecFloat = self.mStartSecFloat self.mCaptureThread.start() @@ -246,7 +246,7 @@ class Recorder: lFileNameStr = self.CaptureChunk(inExtra=inExtra, inForceChunkBool=False) self.mStatusStr = "0_READY" if self.mCallbackStopDef != None: - lCallbackThread = threading.Thread(target=self.mCallbackStopDef,args=[self, lFileNameStr]) + lCallbackThread = threading.Thread(target=self.mCallbackStopDef,args=[self, lFileNameStr], daemon = True) lCallbackThread.start() @@ -309,7 +309,7 @@ class Recorder: "PathStr": lFilePathStr } if self.mCallbackChunkDef != None and self.mFileAvailableChunkInt!=None: - lCallbackThread = threading.Thread(target=self.mCallbackChunkDef,args=[self, lFileNameWExtStr]) + lCallbackThread = threading.Thread(target=self.mCallbackChunkDef,args=[self, lFileNameWExtStr], daemon = True) lCallbackThread.start() self.mStartChunkSecFloat = lTimeSecFloat return lFileNameWExtStr