How to properly use py-webrtcvad?
marc nicole via Python-list <[email protected]> Wed, 22 Jan 2025 22:54:12 +0100
| Newsgroups | gmane.comp.python.general,gmane.comp.python.tutor |
|---|---|
| Message-ID | <CAGJtH9SjCNqLBpULYaFWYn-twK1hB36xW8RgvQFnsS6dny9i_w@mail.gmail.com> |
Hi, I am getting audio from my mic using PyAudio as follows: self.stream = audio.open(format=self.FORMAT, > channels=self.CHANNELS, > rate=self.RATE, > input=True, > frames_per_buffer=self.FRAMES_PER_BUFFER, > input_device_index=1) then reading data as follows: for i in range(0, int(self.RATE / self.FRAMES_PER_BUFFER * > self.RECORD_SECONDS)): > data = self.stream.read(4800) on the other hand I am using py-webrtcvad as follows: self.vad = webrtcvad.Vad() and want to use *is_speech*() using audio data from PyAudio. But getting the error: return _webrtcvad.process(self._vad, sample_rate, buf, length) > Error: Error while processing frame no matter how I changed the input data format (wav: using speech_recognition's *get_wav_data*(), using numpy...) Any suggestions (using Python 2.x)? Thanks.