Skip to content

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

@Varuzhan97

Description

@Varuzhan97

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions