Picovoice WordmarkPicovoice Console
Introduction
Introduction
AndroidC.NETFlutterlink to GoiOSJavaNvidia JetsonLinuxmacOSNodejsPythonRaspberry PiReact NativeRustWebWindows
AndroidC.NETFlutterlink to GoiOSJavaNodejsPythonReact NativeRustWeb
SummaryPicovoice LeopardAmazon TranscribeAzure Speech-to-TextGoogle ASRGoogle ASR (Enhanced)IBM Watson Speech-to-Text
FAQ
Introduction
AndroidC.NETFlutterlink to GoiOSJavaNodejsPythonReact NativeRustWeb
AndroidC.NETFlutterlink to GoiOSJavaNodejsPythonReact NativeRustWeb
FAQ
Introduction
AndroidCiOSLinuxmacOSPythonWebWindows
AndroidCiOSPythonWeb
SummaryOctopus Speech-to-IndexGoogle Speech-to-TextMozilla DeepSpeech
FAQ
Introduction
AndroidAngularArduinoBeagleBoneCChrome.NETEdgeFirefoxFlutterlink to GoiOSJavaNvidia JetsonLinuxmacOSMicrocontrollerNodejsPythonRaspberry PiReactReact NativeRustSafariUnityVueWebWindows
AndroidAngularC.NETFlutterlink to GoiOSJavaMicrocontrollerNodejsPythonReactReact NativeRustUnityVueWeb
SummaryPorcupineSnowboyPocketSphinx
Wake Word TipsFAQ
Introduction
AndroidAngularBeagleBoneCChrome.NETEdgeFirefoxFlutterlink to GoiOSJavaNvidia JetsonlinuxmacOSNodejsPythonRaspberry PiReactReact NativeRustSafariUnityVueWebWindows
AndroidAngularC.NETFlutterlink to GoiOSJavaNodejsPythonReactReact NativeRustUnityVueWeb
SummaryPicovoice RhinoGoogle DialogflowAmazon LexIBM WatsonMicrosoft LUIS
Expression SyntaxFAQ
Introduction
AndroidBeagleboneCiOSNvidia JetsonLinuxmacOSPythonRaspberry PiRustWebWindows
AndroidCiOSPythonRustWeb
SummaryPicovoice CobraWebRTC VAD
FAQ
Introduction
AndroidAngularArduinoBeagleBoneC.NETFlutterlink to GoiOSJavaNvidia JetsonMicrocontrollerNodejsPythonRaspberry PiReactReact NativeRustUnityVueWeb
AndroidAngularCMicrocontroller.NETFlutterlink to GoiOSJavaNodejsPythonReactReact NativeRustUnityVueWeb
Picovoice SDK - FAQ
IntroductionSTM32F407G-DISC1 (Arm Cortex-M4)STM32F411E-DISCO (Arm Cortex-M4)STM32F769I-DISCO (Arm Cortex-M7)IMXRT1050-EVKB (Arm Cortex-M7)
FAQGlossary

Octopus Speech-to-Index
C Quick Start


Platforms

  • Linux (x86_64)
  • macOS (x86_64, arm64)
  • Windows (x86_64)

Requirements

  • C99-compatible compiler
  • CMake (3.13+)
  • For Windows Only: MinGW is required to build the demo

Picovoice Account & AccessKey

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

Quick Start

Setup

  1. Clone the repository:
git clone --recurse-submodules https://github.com/Picovoice/octopus.git

Usage

  1. Include the public header files (picovoice.h and pv_octopus.h).
  2. Link the project to an appropriate precompiled library for the target platform and load it.
  3. Construct the Octopus object:
static const char* ACCESS_KEY = "${ACCESS_KEY}";
const char *model_file_path = "${MODEL_FILE_PATH}";
pv_octopus_t *octopus;
const pv_status_t status = pv_octopus_init(
ACCESS_KEY
model_file_path,
&octopus);
if (status != PV_STATUS_SUCCESS) {
// error handling logic
}
  1. Pass in an audio path to the pv_octopus_index_file function:
static const char* audio_path = "${AUDIO_FILE_PATH}";
void *indices = NULL;
int32_t num_indices_byte = 0;
const pv_status_t status = pv_octopus_index_file(
octopus,
&indices,
&num_indices_byte);
if (status != PV_STATUS_SUCCESS) {
// error handling logic
}
  1. Search for a phrase using pv_octopus_search function:
pv_octopus_match_t *matches = NULL;
int32_t num_matches = 0;
const pv_status_t status = pv_octopus_search(
octopus,
indices,
num_indices_byte,
phrase,
&matches,
&num_matches);
if (status != PV_STATUS_SUCCESS) {
// error handling logic
}
  1. Release resources explicitly when done with Octopus:
free(indices)
free(matches)
pv_octopus_delete(octopus);

Demo

For the Octopus SDK, we offer demo applications that demonstrate how to use the Speech-to-Index engine on audio recordings.

Setup

  1. Clone the Octopus repository from GitHub using HTTPS:
git clone --recurse-submodules https://github.com/Picovoice/octopus.git
  1. Build the demo:
cd octopus
cmake -S demo/c/. -B demo/c/build
cmake --build demo/c/build --target octopus_demo

Usage

Index a given audio file and save the metadata:

./demo/c/build/octopus_index_demo \
lib/${PLATFORM}/${ARCH}/libpv_octopus.so \
lib/common/octopus_params.pv \
${ACCESS_KEY} \
${AUDIO_PATH} \
${INDEX_PATH}

Run the search demo with the index metadata saved from above:

./demo/c/build/octopus_index_demo \
lib/${PLATFORM}/${ARCH}/libpv_octopus.so \
lib/common/octopus_params.pv \
${ACCESS_KEY} \
${INDEX_PATH} \
${PHRASE}

For more information on our Octopus demos for C, head over to our GitHub repository.

Resources

API

  • C API Docs

GitHub

  • Octopus C demo on GitHub

Benchmark

  • Speech-to-Index Benchmark

Further Reading

  • Octopus: Picovoice's Voice Search Engine

Was this doc helpful?

Issue with this doc?

Report a GitHub Issue
Octopus Speech-to-Index C Quick Start
  • Platforms
  • Requirements
  • Picovoice Account & AccessKey
  • Quick Start
  • Setup
  • Usage
  • Demo
  • Setup
  • Usage
  • Resources
Platform
  • Leopard Speech-to-Text
  • Cheetah Streaming Speech-to-Text
  • Octopus Speech-to-Index
  • Porcupine Wake Word
  • Rhino Speech-to-Intent
  • Cobra Voice Activity Detection
Resources
  • Docs
  • Console
  • Blog
  • Demos
Sales
  • Pricing
  • Starter Tier
  • Enterprise
Company
  • Careers
Follow Picovoice
  • LinkedIn
  • GitHub
  • Twitter
  • Medium
  • YouTube
  • AngelList
Subscribe to our newsletter
Terms of Use
Privacy Policy
© 2019-2022 Picovoice Inc.