Typedefs | Functions
include/pv_porcupine.h File Reference
#include <stdbool.h>
#include <stdint.h>
#include "picovoice.h"
Include dependency graph for include/pv_porcupine.h:

Go to the source code of this file.

Typedefs

typedef struct pv_porcupine pv_porcupine_t
 

Functions

PV_API void pv_porcupine_delete (pv_porcupine_t *object)
 
PV_API int32_t pv_porcupine_frame_length (void)
 
PV_API pv_status_t pv_porcupine_init (const char *access_key, const char *model_path, int32_t num_keywords, const char *const *keyword_paths, const float *sensitivities, pv_porcupine_t **object)
 
PV_API pv_status_t pv_porcupine_process (pv_porcupine_t *object, const int16_t *pcm, int32_t *keyword_index)
 
const PV_API char * pv_porcupine_version (void)
 

Typedef Documentation

◆ pv_porcupine_t

typedef struct pv_porcupine pv_porcupine_t

Forward declaration for Porcupine wake word engine. It detects utterances of given keywords within an incoming stream of audio in real-time. It processes incoming audio in consecutive frames and for each frame emits the detection result. The number of samples per frame can be attained by calling 'pv_porcupine_frame_length()'. The incoming audio needs to have a sample rate equal to 'pv_sample_rate()' and be 16-bit linearly-encoded. Porcupine operates on single-channel audio.

Definition at line 33 of file include/pv_porcupine.h.

Function Documentation

◆ pv_porcupine_delete()

PV_API void pv_porcupine_delete ( pv_porcupine_t object)

Destructor.

Parameters
objectPorcupine object.

◆ pv_porcupine_frame_length()

PV_API int32_t pv_porcupine_frame_length ( void  )

Getter for number of audio samples per frame.

Returns
Frame length.

◆ pv_porcupine_init()

PV_API pv_status_t pv_porcupine_init ( const char *  access_key,
const char *  model_path,
int32_t  num_keywords,
const char *const *  keyword_paths,
const float *  sensitivities,
pv_porcupine_t **  object 
)

Constructor.

Parameters
access_keyAccessKey obtained from Picovoice Console (https://console.picovoice.ai/).
model_pathAbsolute path to the file containing model parameters.
num_keywordsNumber of keywords to monitor.
keyword_pathsAbsolute paths to keyword model files.
sensitivitiesSensitivities for detecting keywords. Each value should be a number within [0, 1]. A higher sensitivity results in fewer misses at the cost of increasing the false alarm rate.
[out]objectConstructed instance of Porcupine.
Returns
Status code. Returns 'PV_STATUS_INVALID_ARGUMENT', 'PV_STATUS_IO_ERROR', or 'PV_STATUS_OUT_OF_MEMORY' on failure.

◆ pv_porcupine_process()

PV_API pv_status_t pv_porcupine_process ( pv_porcupine_t object,
const int16_t *  pcm,
int32_t *  keyword_index 
)

Processes a frame of the incoming audio stream and emits the detection result.

Parameters
objectPorcupine object.
pcmA frame of audio samples. The number of samples per frame can be attained by calling 'pv_porcupine_frame_length()'. The incoming audio needs to have a sample rate equal to 'pv_sample_rate()' and be 16-bit linearly-encoded. Porcupine operates on single-channel audio.
[out]keyword_indexIndex of observed keyword at the end of the current frame. Indexing is 0-based and matches the ordering of keyword models provided to 'pv_porcupine_init()'. If no keyword is detected then it is set to -1.
Returns
Status code. Returns 'PV_STATUS_INVALID_ARGUMENT' or 'PV_STATUS_OUT_OF_MEMORY' on failure.

◆ pv_porcupine_version()

const PV_API char* pv_porcupine_version ( void  )

Getter for version.

Returns
Version.


picovoice_driver
Author(s):
autogenerated on Fri Apr 1 2022 02:15:00