Audio fixes in threads

prd
Ivan Maslov 2 years ago
parent 9ad4d7a026
commit e8a0cd1b7b

@ -202,7 +202,7 @@ class Recorder:
frames_per_buffer = self.mFramesInt, frames_per_buffer = self.mFramesInt,
input_device_index = lDeviceInfoDict["index"], input_device_index = lDeviceInfoDict["index"],
as_loopback = not self.mIsMicrophoneBool) 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.mStartSecFloat = time.time()
self.mStartChunkSecFloat = self.mStartSecFloat self.mStartChunkSecFloat = self.mStartSecFloat
self.mCaptureThread.start() self.mCaptureThread.start()
@ -246,7 +246,7 @@ class Recorder:
lFileNameStr = self.CaptureChunk(inExtra=inExtra, inForceChunkBool=False) lFileNameStr = self.CaptureChunk(inExtra=inExtra, inForceChunkBool=False)
self.mStatusStr = "0_READY" self.mStatusStr = "0_READY"
if self.mCallbackStopDef != None: 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() lCallbackThread.start()
@ -309,7 +309,7 @@ class Recorder:
"PathStr": lFilePathStr "PathStr": lFilePathStr
} }
if self.mCallbackChunkDef != None and self.mFileAvailableChunkInt!=None: 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() lCallbackThread.start()
self.mStartChunkSecFloat = lTimeSecFloat self.mStartChunkSecFloat = lTimeSecFloat
return lFileNameWExtStr return lFileNameWExtStr

Loading…
Cancel
Save