Picovoice Wordmark
Start Building
Introduction
Introduction
AndroidC.NETiOSLinuxmacOSNode.jsPythonRaspberry PiWebWindows
AndroidC.NETiOSNode.jsPythonWeb
SummaryPicovoice picoLLMGPTQ
Introduction
AndroidC.NETFlutteriOSJavaLinuxmacOSNode.jsPythonRaspberry PiReactReact NativeWebWindows
AndroidC.NETFlutteriOSJavaNode.jsPythonReactReact NativeWeb
SummaryPicovoice LeopardAmazon TranscribeAzure Speech-to-TextGoogle ASRGoogle ASR (Enhanced)IBM Watson Speech-to-TextWhisper Speech-to-Text
FAQ
Introduction
AndroidC.NETFlutteriOSJavaLinuxmacOSNode.jsPythonRaspberry PiReactReact NativeWebWindows
AndroidC.NETFlutteriOSJavaNode.jsPythonReactReact NativeWeb
SummaryPicovoice CheetahAzure Real-Time Speech-to-TextAmazon Transcribe StreamingGoogle Streaming ASR
FAQ
Introduction
AndroidC.NETiOSLinuxmacOSNode.jsPythonRaspberry PiWebWindows
AndroidC.NETiOSNode.jsPythonWeb
SummaryAmazon PollyAzure TTSElevenLabsOpenAI TTSPicovoice Orca
Introduction
AndroidCiOSLinuxmacOSPythonRaspberry PiWebWindows
AndroidCiOSPythonWeb
SummaryPicovoice KoalaMozilla RNNoise
Introduction
AndroidCiOSLinuxmacOSNode.jsPythonRaspberry PiWebWindows
AndroidCNode.jsPythoniOSWeb
SummaryPicovoice EaglepyannoteSpeechBrainWeSpeaker
Introduction
AndroidCiOSLinuxmacOSPythonRaspberry PiWebWindows
AndroidCiOSPythonWeb
SummaryPicovoice FalconAmazon TranscribeAzure Speech-to-TextGoogle Speech-to-Textpyannote
Introduction
AndroidArduinoCChrome.NETEdgeFirefoxFlutteriOSJavaLinuxmacOSMicrocontrollerNode.jsPythonRaspberry PiReactReact NativeSafariWebWindows
AndroidC.NETFlutteriOSJavaMicrocontrollerNode.jsPythonReactReact NativeWeb
SummaryPicovoice PorcupineSnowboyPocketSphinx
Wake Word TipsFAQ
Introduction
AndroidArduinoCChrome.NETEdgeFirefoxFlutteriOSJavaLinuxmacOSMicrocontrollerNode.jsPythonRaspberry PiReactReact NativeSafariWebWindows
AndroidC.NETFlutteriOSJavaMicrocontrollerNode.jsPythonReactReact NativeWeb
SummaryPicovoice RhinoGoogle DialogflowAmazon LexIBM WatsonMicrosoft LUIS
Expression SyntaxFAQ
Introduction
AndroidArduinoC.NETiOSLinuxmacOSMicrocontrollerNode.jsPythonRaspberry PiWebWindows
AndroidC.NETiOSMicrocontrollerNode.jsPythonWeb
SummaryPicovoice CobraWebRTC VADSilero VAD
FAQ
Introduction
AndroidC.NETFlutteriOSNode.jsPythonReact NativeWeb
AndroidC.NETFlutteriOSNode.jsPythonReact NativeWeb
Introduction
C.NETNode.jsPython
C.NETNode.jsPython
FAQGlossary

Cobra VAD — Arduino Quick Start

Platforms

  • Arduino Nano 33 BLE Sense

Requirements

  • Arduino IDE

Picovoice Account & AccessKey

Signup or Login to Picovoice Console to get your AccessKey. Make sure to keep your AccessKey secret.

Cobra VAD for MCU is currently in Beta and available for evaluation for 30 minutes per device, (i.e., user). If you are working on a commercial project or require extended access, please contact Picovoice with your project details.

Quick Start

Setup

  1. Install and select desired board from Tools -> Board.
    • Install Arduino Mbed OS Nano Boards for Arduino Nano 33 BLE Sense.
  2. Select the desired device Serial Port to upload package via Tools -> Port.
  3. Open the Library Manager in the Arduino IDE.
  4. Search for the Cobra package, and click on the Install button.

Usage

Initialize audio and construct the porcupine object in the setup function:

#include <Cobra.h>
static const char* ACCESS_KEY = "${ACCESS_KEY}";
#define MEMORY_BUFFER_SIZE ${MEMORY_BUFFER_SIZE}
uint8_t memory_buffer[MEMORY_BUFFER_SIZE] __attribute__((aligned(16)));
static const float THRESHOLD = 0.75f;
pv_cobra_t *cobra;
void setup() {
pv_status_t status = pv_audio_init_rec();
if (status != PV_STATUS_SUCCESS) {
// error starting audio
while(1);
}
status = pv_cobra_init(
ACCESS_KEY,
MEMORY_BUFFER_SIZE,
memory_buffer,
&cobra);
if (status != PV_STATUS_SUCCESS) {
// error handling logic
while(1);
}
}

Pass in audio to the pv_cobra_process function:

void loop() {
const int16_t *buffer = pv_audio_rec_get_new_buffer();
if (buffer) {
float voice_probability;
const pv_status_t status = pv_cobra_process(handle, buffer, &voice_probability);
if (status != PV_STATUS_SUCCESS) {
// handle error logic
while(1);
}
if (voice_probability > THRESHOLD) {
// inference event logic/callback
}
}
}

Release resources explicitly when done with Cobra Voice Activity Detection:

pv_cobra_delete(cobra);

Demo

For the Cobra Voice Activity Detection SDK, we offer demo applications that demonstrate how to use the VAD engine on real-time audio streams on Arduino.

Setup

  1. Open the Library Manager in the Arduino IDE.
  2. Search for the Cobra package, and click on the Install button.

Usage

  1. Open File -> Examples -> Cobra -> Cobra.
  2. Replace ACCESS_KEY with the AccessKey obtained from picovoice console.
  3. Press Upload and check Serial Monitor for outputs.

Resources

API

  • Cobra VAD Microcontroller API Docs

GitHub

  • Cobra Voice Activity Detection SDK for Arduino boards

Benchmark

  • Voice Activity Benchmark

Was this doc helpful?

Issue with this doc?

Report a GitHub Issue
Cobra VAD — Arduino Quick Start
  • Platforms
  • Requirements
  • Picovoice Account & AccessKey
  • Quick Start
  • Setup
  • Usage
  • Demo
  • Setup
  • Usage
  • Resources
Voice AI
  • picoLLM On-Device LLM
  • Leopard Speech-to-Text
  • Cheetah Streaming Speech-to-Text
  • Orca Text-to-Speech
  • Koala Noise Suppression
  • Eagle Speaker Recognition
  • Falcon Speaker Diarization
  • Porcupine Wake Word
  • Rhino Speech-to-Intent
  • Cobra Voice Activity Detection
Resources
  • Docs
  • Console
  • Blog
  • Use Cases
  • Playground
Sales & Services
  • Consulting
  • Foundation Plan
  • Enterprise Plan
  • Enterprise Support
Company
  • About us
  • Careers
Follow Picovoice
  • LinkedIn
  • GitHub
  • X
  • YouTube
  • AngelList
Subscribe to our newsletter
Terms of Use
Privacy Policy
© 2019-2025 Picovoice Inc.