Deutsch   English   Français   Italiano  
<mailman.93.1737582833.2912.python-list@python.org>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!news.roellig-ltd.de!open-news-network.org!weretis.net!feeder8.news.weretis.net!fu-berlin.de!uni-berlin.de!not-for-mail
From: marc nicole <mk1853387@gmail.com>
Newsgroups: comp.lang.python
Subject: How to properly use py-webrtcvad?
Date: Wed, 22 Jan 2025 22:54:12 +0100
Lines: 36
Message-ID: <mailman.93.1737582833.2912.python-list@python.org>
References: <CAGJtH9SjCNqLBpULYaFWYn-twK1hB36xW8RgvQFnsS6dny9i_w@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Trace: news.uni-berlin.de f9F371+RAlwj+o9Ju/jpkwfaCZi2bdvPIztjvMbZxIjw==
Cancel-Lock: sha1:xsxhZkLl2wQpM5fl90DgAVneElo= sha256:QO0T9RDFA2v+hApWaiqWgx7s7+DimMQLrGM+uPPni3k=
Return-Path: <mk1853387@gmail.com>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
 reason="2048-bit key; unprotected key"
 header.d=gmail.com header.i=@gmail.com header.b=YQ+T1WFS;
 dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.091
X-Spam-Evidence: '*H*': 0.82; '*S*': 0.00; 'error:': 0.05; 'skip:_
 20': 0.09; 'skip:\xc2 20': 0.09; 'mic': 0.16; 'python': 0.16;
 'to:addr:python-list': 0.20; 'input': 0.21; 'to:no real
 name:2**1': 0.22; 'follows:': 0.26; 'suggestions': 0.28; 'error':
 0.29; 'sfxlen:2': 0.31; 'subject:How': 0.31; 'message-
 id:@mail.gmail.com': 0.31; 'but': 0.32; 'received:google.com':
 0.34; 'from:addr:gmail.com': 0.34; 'using': 0.37; 'use': 0.39;
 'hand': 0.40; 'want': 0.40; 'skip:\xc2 10': 0.62; 'skip:i 20':
 0.62; 'format': 0.62; '8bit%:9': 0.64; 'matter': 0.68; 'skip:\xc2
 40': 0.69; 'audio': 0.70; 'skip:* 10': 0.73
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1737582829; x=1738187629; darn=python.org;
 h=to:subject:message-id:date:from:mime-version:from:to:cc:subject
 :date:message-id:reply-to;
 bh=c3/ZYBUugENn+CA5YdSYyEEUSvhaFZDE6Ui6LdRWI/g=;
 b=YQ+T1WFS3jca/7gEr6XQHh8d/iKymuTm51MZh0qSmt2JPllCr01Oq3s9t+v6dUtqIg
 uCyr6KufyJD4PnRcpLL5kn8WeKEg1Y6tbziMuEEdymXtqDc1dtjaXMXkZoeuVdqjEFo1
 jlKvgn61PKadE2yTtVqRsl85AIv/u6+iBtnRVgOaVe0pdg87VCstg8DVVTaoSji1MoEv
 /Qt0CrBRhl+5mpqclJRLfLVdsO00PKGzLKLsZ/RP3f9GenJBmnp3yMjBePReEiQHbfZU
 7RGDmdCVDAtykm/yOdlacB2H25urzhN3AjvKS/kxduHMOnTsLgsYq5L99JI5fa4Reygp
 965Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1737582829; x=1738187629;
 h=to:subject:message-id:date:from:mime-version:x-gm-message-state
 :from:to:cc:subject:date:message-id:reply-to;
 bh=c3/ZYBUugENn+CA5YdSYyEEUSvhaFZDE6Ui6LdRWI/g=;
 b=MP8++QO+i89TBRw0TQ8fJ4bxf4Ap/lI3jhG4aKtE3Lcxx8s7MsM+wC68lhwmkMtCWu
 21T+UwqtVVAOGFkZSrz7yLJtvl23zSba7EuF35ebVYOrLmxCukUe1yMZt+5Lhhhv4mt3
 XN7AMwX98PxfdDHOHBoZEbHyE1nksd10zI9GJTxv44hkidXPuWqA6UVw7W4s4pHyOLJB
 gZys8db1+c+CYKAQfSHdMLhbQxQOWlPuY+UQeHOOrQKQSDmhfaRdi1reNqPUfpTXriWg
 Fjd2W+WmN0ynoO7O8QjN/T7wFKS4YwoqRaVb7XVtccnZ9zH0Rua9djG08mIwGWMPNc8m
 nu/g==
X-Forwarded-Encrypted: i=1;
 AJvYcCXqaco5bvcxLrH9nXG1CaxRB/9GnkBlIyoF+8MFlBcWj3Ut6NmRVwdT3Q21tgACz+ci0idymiPzIJjHkQ==@python.org
X-Gm-Message-State: AOJu0YzrIqSDkdARLbNCwokKzbS0vRMCsuj2RZFBVE+FMgR7NAfWNa/2
 9NNiTklfU3iaSRzA4rALGrwdH5y8n7P7FbOYEr5WHNZd6AiqRi33PTR3pLv+Nc6+iv5m7b1ehJ5
 8kMblR3IYNfjkXeHTUCIB7oPB9KKs2xIDlVM=
X-Gm-Gg: ASbGnctIXufC+N9qcQS+T4d5dwwcFORG24Pldzmnx7s5moNGH6457KZsTIn1cLK0sq6
 cHXsOCDXbbrVO1JxC9HmmBpPzWl7e3MbKzM5403nhYMC4X/IYMUuj
X-Google-Smtp-Source: AGHT+IG62437XAN42gG2urBzoyEFiiobl/26Dyyc+KG/JQC9+MfQpO4wiWSsZDT/1aSh+CEmOVj4kDqKJ8ISIVyPvxo=
X-Received: by 2002:a25:d607:0:b0:e58:5cf:bc47 with SMTP id
 3f1490d57ef6-e5805cfbe95mr4909835276.2.1737582829141; Wed, 22 Jan 2025
 13:53:49 -0800 (PST)
X-Gm-Features: AbW1kvaTfepmVn_NcERTebC5zMu2UsHacermo33AXa9JYCuya_-RC791iaz1DTk
X-Content-Filtered-By: Mailman/MimeDel 2.1.39
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
 <python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
 <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
 <mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <CAGJtH9SjCNqLBpULYaFWYn-twK1hB36xW8RgvQFnsS6dny9i_w@mail.gmail.com>
Bytes: 5582

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.