after several days of hard debugging, I had to remove the call of self.sys_handle.on_captured_frame from captured_frame.
I tried to break the audio frame in Unity AudioSource into 10ms frames, or directly pass all buffers into captured_frame. However, due to some call jitter, the encoded sound jittered and the delay accumulated. I guess some lock contention caused it, but I couldn't find the real reason.
So the current way that works perfectly is to use enable_queue to control whether to execute the interval.tick() timer wait inside spawn, and whether to insert a silent frame when po_rx is empty.
I will resubmit the patch when I find a better solution
after several days of hard debugging, I had to remove the call of
self.sys_handle.on_captured_frame
fromcaptured_frame
. I tried to break the audio frame in Unity AudioSource into 10ms frames, or directly pass all buffers into captured_frame. However, due to some call jitter, the encoded sound jittered and the delay accumulated. I guess some lock contention caused it, but I couldn't find the real reason.So the current way that works perfectly is to use
enable_queue
to control whether to execute theinterval.tick()
timer wait insidespawn
, and whether to insert a silent frame whenpo_rx
is empty.I will resubmit the patch when I find a better solution