Skip to main content

Cobra voice activity detection (VAD) engine

Project description

Cobra Voice Activity Detection Engine

Made in Vancouver, Canada by Picovoice

Cobra is a highly accurate and lightweight voice activity detection (VAD) engine.

Compatibility

  • Python 3.9+
  • Runs on Linux (x86_64), macOS (x86_64), Windows (x86_64, arm64), and Raspberry Pi (3, 4, 5).

Installation

pip3 install pvcobra

AccessKey

Cobra requires a valid Picovoice AccessKey at initialization. AccessKey acts as your credentials when using Cobra SDKs. You can get your AccessKey for free. Make sure to keep your AccessKey secret. Signup or Login to Picovoice Console to get your AccessKey.

Usage

Create an instance of the engine

import pvcobra

handle = pvcobra.create(access_key=${AccessKey})

Replace ${AccessKey} with your AccessKey obtained from Picovoice Console. handle is an instance of Cobra.

When initialized, the valid sample rate is given by handle.sample_rate. Expected frame length (number of audio samples in an input array) is handle.frame_length. The engine accepts 16-bit linearly-encoded PCM and operates on single-channel audio.

def get_next_audio_frame():
    pass

while True:
    voice_probability = handle.process(get_next_audio_frame())

When done, resources have to be released explicitly:

handle.delete()

Demos

pvcobrademo provides command-line utilities for processing real-time audio (i.e. microphone) and files using Cobra.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pvcobra-3.0.2.tar.gz (3.0 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pvcobra-3.0.2-py3-none-any.whl (3.0 MB view details)

Uploaded Python 3

File details

Details for the file pvcobra-3.0.2.tar.gz.

File metadata

  • Download URL: pvcobra-3.0.2.tar.gz
  • Upload date:
  • Size: 3.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for pvcobra-3.0.2.tar.gz
Algorithm Hash digest
SHA256 1b57825da0da703c602e4d3299e2585be1cd5ac6e6692930b69ae67e6d8d1a08
MD5 0800c9435e77486c99a25f9e08d5c51a
BLAKE2b-256 01afe5c01bed832f9c569fc41b5c401ab7d380663c6a1f301765ded1af5c6559

See more details on using hashes here.

File details

Details for the file pvcobra-3.0.2-py3-none-any.whl.

File metadata

  • Download URL: pvcobra-3.0.2-py3-none-any.whl
  • Upload date:
  • Size: 3.0 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for pvcobra-3.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 aa03a8bd5de8fd45c17ae84db79c3c426e924f12b8a55efce157ffa899a0d718
MD5 d1435c31eb9712eaa3dad8ba9700ccff
BLAKE2b-256 db013df5dbe52ac1eec5571744b1f837ade63f09720ac32bf33471f2a150bab8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page