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.8+
  • Runs on Linux (x86_64), macOS (x86_64), Windows (x86_64), 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-2.0.3.tar.gz (1.8 MB view details)

Uploaded Source

Built Distribution

pvcobra-2.0.3-py3-none-any.whl (1.8 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pvcobra-2.0.3.tar.gz
  • Upload date:
  • Size: 1.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.5

File hashes

Hashes for pvcobra-2.0.3.tar.gz
Algorithm Hash digest
SHA256 13d8dec7bbdca9f7bd54c37ade2a6cc6b467420e21a26cf087ecb1601ed78b6d
MD5 ce42c43e7c1d4a5f98ff2fac326e2e03
BLAKE2b-256 b84778f5a93b5724ce91dec26f3df4d84d70a0c96d8bf55bf6aad2b862db58ae

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pvcobra-2.0.3-py3-none-any.whl
  • Upload date:
  • Size: 1.8 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.5

File hashes

Hashes for pvcobra-2.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 227f31c321f3ef688b24d9b6f89ffa9460b9042f80c2c5ec260e9853416fe48f
MD5 2dc5abba006724548fc18d5e97d53809
BLAKE2b-256 92fd8e2ed1bb40329f6c9533556ef1ec2045030d360e69d317cc313107ede600

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