How to properly use py-webrtcvad?

Liste des GroupesRevenir à cl python 
Sujet : How to properly use py-webrtcvad?
De : mk1853387 (at) *nospam* gmail.com (marc nicole)
Groupes : comp.lang.python
Date : 22. Jan 2025, 22:54:12
Autres entêtes
Message-ID : <mailman.93.1737582833.2912.python-list@python.org>
References : 1
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.

Date Sujet#  Auteur
22 Jan 25 * How to properly use py-webrtcvad?2marc nicole
26 Jan 25 `- Re: How to properly use py-webrtcvad?1Stefan Ram

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal