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.3.tar.gz (3.2 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.3-py3-none-any.whl (3.2 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pvcobra-3.0.3.tar.gz
  • Upload date:
  • Size: 3.2 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.3.tar.gz
Algorithm Hash digest
SHA256 cef39ee5f915ef2422d36f7d65423702a851e2a53f4b4c7444f0d45e00c1ebee
MD5 f71b2613e569841c709a4fbb10ceb4a3
BLAKE2b-256 895f255c0793c8095f671e90be2ddbb7bb5bde4bfe37ba445c9edbe816554473

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pvcobra-3.0.3-py3-none-any.whl
  • Upload date:
  • Size: 3.2 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 63adeb59417f3cf243f29bab4233251ec2b66919b0a31c317e5ef6dec9f65df4
MD5 71dbdbb1e9d64d01a3773795ec77fc87
BLAKE2b-256 60c22fc5c72dc0235326afde7424e0b26c425049b782a34c523e6b09440d5d45

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