Picovoice Wordmark
Start Building
Introduction
Introduction
AndroidC.NETiOSLinuxmacOSNode.jsPythonRaspberry PiWebWindows
AndroidC.NETiOSNode.jsPythonWeb
SummaryPicovoice picoLLMGPTQ
Introduction
AndroidC.NETFlutteriOSJavaLinuxmacOSNode.jsPythonRaspberry PiReactReact NativeRustWebWindows
AndroidC.NETFlutteriOSJavaNode.jsPythonReactReact NativeRustWeb
SummaryPicovoice LeopardAmazon TranscribeAzure Speech-to-TextGoogle ASRGoogle ASR (Enhanced)IBM Watson Speech-to-TextWhisper Speech-to-Text
FAQ
Introduction
AndroidC.NETFlutteriOSJavaLinuxmacOSNode.jsPythonRaspberry PiReactReact NativeRustWebWindows
AndroidC.NETFlutteriOSJavaNode.jsPythonReactReact NativeRustWeb
SummaryPicovoice Cheetah
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 NativeRustSafariUnityWebWindows
AndroidC.NETFlutteriOSJavaMicrocontrollerNode.jsPythonReactReact NativeRustUnityWeb
SummaryPorcupineSnowboyPocketSphinx
Wake Word TipsFAQ
Introduction
AndroidCChrome.NETEdgeFirefoxFlutteriOSJavaLinuxmacOSNode.jsPythonRaspberry PiReactReact NativeRustSafariUnityWebWindows
AndroidC.NETFlutteriOSJavaNode.jsPythonReactReact NativeRustUnityWeb
SummaryPicovoice RhinoGoogle DialogflowAmazon LexIBM WatsonMicrosoft LUIS
Expression SyntaxFAQ
Introduction
AndroidC.NETiOSLinuxmacOSNode.jsPythonRaspberry PiRustWebWindows
AndroidC.NETiOSNode.jsPythonRustWeb
SummaryPicovoice CobraWebRTC VAD
FAQ
Introduction
AndroidC.NETFlutteriOSNode.jsPythonReact NativeRustUnityWeb
AndroidC.NETFlutteriOSNode.jsPythonReact NativeRustUnityWeb
Introduction
C.NETNode.jsPython
C.NETNode.jsPython
FAQGlossary

Eagle Speaker Recognition
Node.js API

API Reference for the Eagle Node.js SDK (npm).


Eagle

class Eagle {}

Class for using the recognizer component of the Eagle Speaker Recognition engine. The recognizer processes incoming audio in consecutive frames and emits a similarity score for each enrolled speaker.

Eagle can be initialized using the class constructor(). Resources should be cleaned when you are done using the release() method.


Eagle.constructor()

Eagle.constructor(
accessKey: string,
speakerProfiles: Uint8Array[] | Uint8Array,
options: EagleOptions = {}
)

Eagle constructor.

Parameters

  • accessKey string : AccessKey obtained from Picovoice Console.
  • speakerProfiles Uint8Array[] | Uint8Array : One or more Eagle speaker profiles. These can be constructed using EagleProfiler.
  • options EagleOptions: Optional configuration arguments:
    • modelPath string : Path to the file containing model parameters (.pv).
    • libraryPath string : Path to the Eagle dynamic library (.node).

Returns

  • Eagle: An instance of Eagle platform.

Eagle.release()

Eagle.release()

Releases resources acquired by Eagle.


Eagle.reset()

Eagle.reset()

Resets the internal state of the 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.


Eagle.frameLength

Eagle.frameLength()

Getter for number of audio samples per frame expected by Eagle (i.e. length of the array passed into .process())


Eagle.sampleRate

Eagle.sampleRate()

Getter for audio sample rate accepted by Eagle.


Eagle.version

Eagle.version()

Getter for Eagle version.


Eagle.process()

Eagle.process(pcm)

Processes a frame of audio and returns a list of similarity scores for each speaker profile.

Parameters

  • pcm Int16Array : A frame of audio samples. The number of samples per frame can be attained by calling .frameLength. The incoming audio needs to have a sample rate equal to .sampleRate and be 16-bit linearly-encoded. Eagle operates on single-channel audio.

Returns

  • number[] : A list of similarity scores for each speaker profile. A higher score indicates that the voice belongs to the corresponding speaker. The range is [0, 1] with 1.0 representing a perfect match.

EagleProfiler

class EagleProfiler {}

Class for using the profiler component of the Eagle Speaker Recognition engine on the main thread of your application. The profiler is responsible for enrolling a speaker given a set of utterances and exporting a speaker profile.


EagleProfiler.constructor()

EagleProfiler.constructor(
accessKey: string,
options: EagleOptions = {}
)

Creates an instance of the profiler component of the Eagle Speaker Recognition engine.

Parameters

  • accessKey string : AccessKey obtained from Picovoice Console.
  • options EagleOptions: Optional configuration arguments:
    • modelPath string : Path to the file containing model parameters (.pv).
    • libraryPath string : Path to the Eagle dynamic library (.node).

Returns

  • EagleProfiler : An instance of the EagleProfiler.

EagleProfiler.frameLength

EagleProfiler.frameLength()

Getter for number of audio samples per frame expected by EagleProfiler (i.e. length of the array passed into .enroll())


EagleProfiler.sampleRate

EagleProfiler.sampleRate()

Getter for audio sample rate accepted by EagleProfiler.


EagleProfiler.version

EagleProfiler.version()

Getter for EagleProfiler version.


EagleProfiler.minEnrollSamples

EagleProfiler.minEnrollSamples()

The minimum length of the input pcm required by .enroll().


EagleProfiler.enroll()

EagleProfiler.enroll(pcm)

Enrolls a speaker. This function should be called multiple times with different utterances of the same speaker until the enrollment percentage reaches 100.0 at which point a speaker voice profile can be exported using .export(). Any further enrollment can be used to improve the speaker voice profile. The minimum number of required samples can be obtained by calling .minEnrollSamples. 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
  • 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

  • pcm Int16Array : Audio data. The audio needs to have a sample rate equal to .sampleRate and be 16-bit linearly-encoded. EagleProfiler operates on single-channel audio.

Returns

  • EnrollProgress : The percentage of completeness of the speaker enrollment process along with the feedback code corresponding to the last enrollment attempt.

EagleProfiler.export()

EagleProfiler.export()

Exports the speaker profile of the current session. Will throw error if the profile is not ready.

Returns

  • Uint8Array : The Eagle speaker profile.

EagleProfiler.reset()

EagleProfiler.reset()

Resets the internal state of Eagle Profiler. It should be called before starting a new enrollment session.


EagleProfiler.release()

EagleProfiler.release()

Releases resources acquired by Eagle Profiler.


EagleProfilerEnrollFeedback

enum EagleProfilerEnrollFeedback {
NONE = "NONE",
AUDIO_TOO_SHORT = "AUDIO_TOO_SHORT",
UNKNOWN_SPEAKER = "UNKNOWN_SPEAKER",
NO_VOICE_FOUND = "NO_VOICE_FOUND",
QUALITY_ISSUE = "QUALITY_ISSUE",
}
  • NONE: The audio is good for enrollment.
  • AUDIO_TOO_SHORT: Audio length is insufficient for enrollment, i.e. it is shorter than.min_enroll_samples.
  • UNKNOWN_SPEAKER: There is another speaker in the audio that is different from the speaker being enrolled. Too much background noise may cause this error as well.
  • NO_VOICE_FOUND: The audio does not contain any voice, i.e. it is silent or has a low signal-to-noise ratio.
  • QUALITY_ISSUE: The audio quality is too low for enrollment due to a bad microphone or recording environment.

EnrollProgress

type EnrollProgress = {
feedback: EagleProfilerEnrollFeedback;
percentage: number;
}

Type for storing the results of .enroll().

  • feedback EagleProfilerEnrollFeedback : A feedback code corresponding to the last enrollment attempt.
  • percentage number : The percentage of completeness of the speaker enrollment process.

Was this doc helpful?

Issue with this doc?

Report a GitHub Issue
Eagle Speaker Recognition Node.js API
  • Eagle
  • constructor()
  • release()
  • reset()
  • frameLength
  • sampleRate
  • version
  • process()
  • EagleProfiler
  • constructor()
  • frameLength
  • sampleRate
  • version
  • minEnrollSamples
  • enroll()
  • export()
  • reset()
  • release()
  • EagleProfilerEnrollFeedback
  • EnrollProgress
Voice AI
  • 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
Local LLM
  • picoLLM Inference
  • picoLLM Compression
  • picoLLM GYM
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.