Picovoice Wordmark
Start Building
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 GoiOSJavaNVIDIA JetsonLinuxmacOSNodejsPythonRaspberry PiReact NativeRustWebWindows
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
AndroidCiOSNVIDIA JetsonLinuxmacOSPythonRaspberry PiWebWindows
AndroidCiOSPythonWeb
SummaryPicovoice KoalaMozilla RNNoise
Introduction
AndroidCiOSNVIDIA JetsonLinuxmacOSPythonRaspberry PiWebWindows
AndroidCPythoniOSWeb
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)
Introduction
AndroidC.NETFlutterlink to GoiOSNodejsPythonReact NativeRustUnityWeb
AndroidC.NETFlutterlink to GoiOSNodejsPythonReact NativeRustUnityWeb
FAQGlossary

Eagle Speaker Recognition
C API

API Reference for the Eagle C SDK .


pv_eagle_profiler_t

typedef struct pv_eagle_profiler pv_eagle_profiler_t;

Struct representing the profiler component of the Eagle Speaker Recognition engine.


pv_eagle_profiler_init()

pv_status_t pv_eagle_profiler_init(
const char *access_key,
const char *model_path,
pv_eagle_profiler_t **object);

Creates an instance of the profiler component of the Eagle Speaker Recognition engine. Resources should be cleaned when you are done using the pv_eagle_profiler_delete() function.

Parameters

  • access_key const char * : AccessKey obtained from Picovoice Console .
  • model_path const char * : Absolute path to the file containing model parameters (.pv).
  • object pv_eagle_profiler_t * * : Constructed instance of the Eagle profiler.

Returns

  • pv_status_t : Status code.

pv_eagle_profiler_delete()

void pv_eagle_profiler_delete(pv_eagle_profiler_t *object);

Releases resources acquired by the Eagle profiler.

Parameters

  • object pv_eagle_profiler_t * : Eagle profiler object.

pv_eagle_profiler_enroll()

pv_status_t pv_eagle_profiler_enroll(
pv_eagle_profiler_t *object,
const int16_t *pcm,
int32_t num_samples,
pv_eagle_profiler_enroll_feedback_t *feedback,
float *percentage);

Enrolls a speaker. This function should be called multiple times with different utterances of the same speaker until percentage reaches 100.0. Any further enrollment can be used to improve the speaker voice profile. The minimum number of required samples can be obtained by calling pv_eagle_profiler_enroll_min_audio_length_samples(). The audio data used for enrollment should satisfy the following requirements:

  • only one speaker should be present in the audio
  • the speaker should be speaking in a normal voice (i.e. not whispering or shouting)
  • the audio should contain no speech from other speakers and no other sounds (e.g. music)
  • it should be captured in a quiet environment with no background noise

Parameters

  • object pv_eagle_profiler_t * : Eagle profiler object.

  • pcm int16_t : Audio data. The required sample rate can be attained by calling pv_sample_rate(). The required audio format is 16-bit linearly-encoded single-channel PCM. The minimum audio length required for enrollment can be attained by calling pv_eagle_profiler_enroll_min_audio_length_samples().

  • num_samples int32_t : Number of audio samples in pcm.

  • feedback pv_eagle_profiler_enroll_feedback_t * : Feedback code. If any problems arise with the provided input audio, it will be assigned a suitable feedback code to indicate the potential issue:

    • PV_EAGLE_PROFILER_ENROLL_FEEDBACK_AUDIO_TOO_SHORT: The audio is too short, i.e. it contains less than the minimum number of required samples,
    • PV_EAGLE_PROFILER_ENROLL_FEEDBACK_UNKNOWN_SPEAKER: The speaker is unknown, i.e. the speaker is not the same as the one enrolled in the previous enrollment,
    • PV_EAGLE_PROFILER_ENROLL_FEEDBACK_NO_VOICE_FOUND: The audio does not contain any speech,
    • PV_EAGLE_PROFILER_ENROLL_FEEDBACK_QUALITY_ISSUE: The audio is too noisy or the speaker is speaking in a low voice.

    otherwise, it will be set to PV_EAGLE_PROFILER_ENROLL_FEEDBACK_AUDIO_OK.

  • percentage float : Percentage of enrollment progress. When this value reaches 100.0, the enrollment process is complete.

Returns

  • pv_status_t : Status code.

pv_eagle_profiler_enroll_min_audio_length_samples()

pv_status_t pv_eagle_profiler_enroll_min_audio_length_samples(
const pv_eagle_profiler_t *object,
int32_t *num_samples);

Gets the minimum length of the input pcm required by pv_eagle_profiler_enroll().

Parameters

  • object pv_eagle_profiler_t * : Eagle profiler object.

Returns

  • pv_status_t : Status code.

pv_eagle_profiler_export()

pv_status_t pv_eagle_profiler_export(
const pv_eagle_profiler_t *object,
void *speaker_profile);

Exports the speaker profile to a buffer. The exported profile can be used in pv_eagle_init() or stored for later use.

Parameters

  • object pv_eagle_profiler_t * : Eagle profiler object.
  • speaker_profile void * : Buffer where the speaker profile will be stored. Must be pre-allocated with a size obtained by calling pv_eagle_profiler_export_size().

Returns

  • pv_status_t : Status code.

pv_eagle_profiler_reset()

pv_status_t pv_eagle_profiler_reset(pv_eagle_profiler_t *object);

Resets the EagleProfiler object and removes all enrollment data. It must be called before enrolling a new speaker.

Parameters

  • object pv_eagle_profiler_t * : Eagle profiler object.

Returns

  • pv_status_t : Status code.


pv_eagle_profiler_enroll_feedback_t

typedef enum {
PV_EAGLE_PROFILER_ENROLL_FEEDBACK_AUDIO_OK = 0,
PV_EAGLE_PROFILER_ENROLL_FEEDBACK_AUDIO_TOO_SHORT,
PV_EAGLE_PROFILER_ENROLL_FEEDBACK_UNKNOWN_SPEAKER,
PV_EAGLE_PROFILER_ENROLL_FEEDBACK_NO_VOICE_FOUND,
PV_EAGLE_PROFILER_ENROLL_FEEDBACK_QUALITY_ISSUE,
} pv_eagle_profiler_enroll_feedback_t;

Enrollment feedback enum.


pv_eagle_profiler_enroll_feedback_to_string()

const char *pv_eagle_profiler_enroll_feedback_to_string(pv_eagle_profiler_enroll_feedback_t feedback);

Parameters

  • status int32_t : Feedback code.

Returns

  • const char * : String representation of feedback code.

pv_eagle_t

typedef struct pv_eagle pv_eagle_t;

Struct representing the recognizer component of the Eagle Speaker Recognition engine.


pv_eagle_init()

pv_status_t pv_eagle_init(
const char *access_key,
const char *model_path,
int32_t num_speakers,
const void *const *speaker_profiles,
pv_eagle_t **object);

Creates an instance of the recognizer component of the Eagle Speaker Recognition engine. Resources should be cleaned when you are done using the pv_eagle_delete() function.

Parameters

  • access_key const char * : AccessKey obtained from Picovoice Console .
  • model_path const char * : Absolute path to the file containing model parameters (.pv).
  • num_speakers int32_t : Number of speakers to enroll.
  • speaker_profiles const void * const * : Speaker profiles. This can be created using the EagleProfiler object and its related functions.
  • object pv_eagle_t * : Constructed instance of the Eagle engine.

Returns

  • pv_status_t : Status code.

pv_eagle_delete()

void pv_eagle_delete(pv_eagle_t *object);

Releases the resources acquired by the Eagle engine.

Parameters

  • object pv_eagle_t * : Eagle object.

Returns

  • pv_status_t : Status code.

pv_eagle_process()

pv_status_t pv_eagle_process(
pv_eagle_t *object,
const int16_t *pcm,
float *scores);

Processes a frame of the incoming audio stream. The incoming audio needs to have a sample rate equal to pv_sample_rate().

Parameters

  • object pv_eagle_t * : Eagle object.
  • pcm const int16_t * : A frame of audio samples. The number of samples per frame can be attained by calling pv_eagle_frame_length(). The incoming audio needs to have a sample rate equal to pv_sample_rate() and be 16-bit linearly-encoded. Eagle operates on single-channel audio.
  • scores float * : Similarity scores for each enrolled speaker. Must be pre-allocated with a size equal to the number of enrolled speakers. The scores are in the range [0, 1] with 1 being a perfect match.

Returns

  • pv_status_t : Status code.

pv_eagle_reset()

pv_status_t pv_eagle_reset(pv_eagle_t *object);

Resets the internal state of the Eagle engine. It is best to call before processing a new sequence of audio (e.g. a new voice interaction). This ensures that the accuracy of the engine is not affected by a change in audio context.

Parameters

  • object pv_eagle_t * : Eagle object.

Returns

  • pv_status_t : Status code.

pv_eagle_frame_length()

int32_t pv_eagle_frame_length(void);

Getter for number of audio samples per frame.

Returns

  • int32_t : Frame length.

pv_eagle_version()

const char *pv_eagle_version(void);

Getter for version.

Returns

  • const char * : Eagle version.

pv_sample_rate()

int32_t pv_sample_rate(void);

Audio sample rate accepted by Eagle.

Returns

  • int32_t : Sample rate.

pv_status_t

typedef enum {
PV_STATUS_SUCCESS = 0,
PV_STATUS_OUT_OF_MEMORY,
PV_STATUS_IO_ERROR,
PV_STATUS_INVALID_ARGUMENT,
PV_STATUS_STOP_ITERATION,
PV_STATUS_KEY_ERROR,
PV_STATUS_INVALID_STATE,
PV_STATUS_RUNTIME_ERROR,
PV_STATUS_ACTIVATION_ERROR,
PV_STATUS_ACTIVATION_LIMIT_REACHED,
PV_STATUS_ACTIVATION_THROTTLED,
PV_STATUS_ACTIVATION_REFUSED
} pv_status_t;

Status code enum.


pv_status_to_string()

const char *pv_status_to_string(pv_status_t status);

Parameters

  • status int32_t : Status code.

Returns

  • const char * : String representation of status code.

Was this doc helpful?

Issue with this doc?

Report a GitHub Issue
Eagle Speaker Recognition C API
  • pv_eagle_profiler_t
  • pv_eagle_profiler_init()
  • pv_eagle_profiler_delete()
  • pv_eagle_profiler_enroll()
  • pv_eagle_profiler_enroll_min_audio_length_samples()
  • pv_eagle_profiler_export()
  • pv_eagle_profiler_reset()
  • pv_eagle_profiler_enroll_feedback_t
  • pv_eagle_profiler_enroll_feedback_to_string()
  • pv_eagle_t
  • pv_eagle_init()
  • pv_eagle_delete()
  • pv_eagle_process()
  • pv_eagle_reset()
  • pv_eagle_frame_length()
  • pv_eagle_version()
  • pv_sample_rate()
  • pv_status_t
  • pv_status_to_string()
Platform
  • Leopard Speech-to-Text
  • Cheetah Streaming Speech-to-Text
  • Koala Noise Suppression
  • Eagle Speaker RecognitionBETA
  • Octopus Speech-to-Index
  • Porcupine Wake Word
  • Rhino Speech-to-Intent
  • Cobra Voice Activity Detection
  • Orca Text-to-SpeechWAITLIST
  • Falcon Speaker DiarizationWAITLIST
Resources
  • Docs
  • Console
  • Blog
  • Use Cases
Sales & Services
  • Consulting
  • Developer Plan
  • Enterprise Plan
  • Support Add-on
Company
  • About us
  • Careers
Follow Picovoice
  • LinkedIn
  • GitHub
  • Twitter
  • Medium
  • YouTube
  • AngelList
Subscribe to our newsletter
Terms of Use
Privacy Policy
© 2019-2022 Picovoice Inc.