Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mic_vad_streaming.py freezes when trying to record 4 channels and convert to 1 channel. #47

Open
Varuzhan97 opened this issue Nov 8, 2022 · 0 comments

Comments

@Varuzhan97
Copy link

Varuzhan97 commented Nov 8, 2022

def four_to_one(self, frame): #[ch1,ch2,ch3,ch4||ch1,ch2,ch3,ch4||ch1,ch2,ch3,ch4||ch1,ch2,ch3,ch4] frame = np.frombuffer(frame, np.int16) data = frame.reshape((self.CHANNELS,-1), order='F') b = 1/self.CHANNELS x = np.int16(0) for c in data: x+=c*b frame = (x.astype(np.int16)).tobytes() return frame
The above code is part of converting 4 channels frame to 1 channel. mic_vad_streaming.py file freezes when running on Raspberry and trying to record 4 channels. The function mentioned above is called inside the vad_collector function when length of the frame is larger than 2560.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant