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.7+
  • Runs on Linux (x86_64), macOS (x86_64), Windows (x86_64), Raspberry Pi, NVIDIA Jetson (Nano), and BeagleBone.

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-2.0.2.tar.gz (2.2 MB view details)

Uploaded Source

Built Distribution

pvcobra-2.0.2-py3-none-any.whl (2.2 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pvcobra-2.0.2.tar.gz
  • Upload date:
  • Size: 2.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.12

File hashes

Hashes for pvcobra-2.0.2.tar.gz
Algorithm Hash digest
SHA256 ed80b0b9b58eb6873500f00826c6685a417e164e23adf9b5805c716a1a0721c1
MD5 a7d53f045a48ff5c6c29e2d244a5bc38
BLAKE2b-256 454f0f2efd90b21a473c4ead262655ce2108f11d9ec8f28ee069af1f1940b0af

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pvcobra-2.0.2-py3-none-any.whl
  • Upload date:
  • Size: 2.2 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.12

File hashes

Hashes for pvcobra-2.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b585b5adfbf5e762d60a66165de718c62affe2b243f71ca2138ef7798e7e044c
MD5 96bb0d9cc9f4dbdf9b8115ec9bb86ef7
BLAKE2b-256 78ce632f3587e4a813b1f99f622f45dcc0dda0470d20bcc274b4c5fece569071

See more details on using hashes here.

Supported by

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