Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #197214

How to properly use py-webrtcvad?

From marc nicole <mk1853387@gmail.com>
Newsgroups comp.lang.python
Subject How to properly use py-webrtcvad?
Date 2025-01-22 22:54 +0100
Message-ID <mailman.93.1737582833.2912.python-list@python.org> (permalink)
References <CAGJtH9SjCNqLBpULYaFWYn-twK1hB36xW8RgvQFnsS6dny9i_w@mail.gmail.com>

Show all headers | View raw


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.

Back to comp.lang.python | Previous | Next | Find similar


Thread

How to properly use py-webrtcvad? marc nicole <mk1853387@gmail.com> - 2025-01-22 22:54 +0100

csiph-web