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
Web API

API Reference for the Eagle Web SDK (npm).


Eagle

class Eagle {}

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


Eagle.create()

static async function create(
accessKey: string,
model: EagleModel,
speakerProfiles: EagleProfile[] | EagleProfile
): Promise<EagleProfiler>

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

Parameters

  • accessKey string : AccessKey obtained from Picovoice Console.
  • model EagleModel : Eagle model options.
  • speakerProfiles EagleProfile[] | EagleProfile : One or more Eagle speaker profiles. These can be constructed using EagleProfiler.

Returns

  • Eagle : An instance of the Eagle.

Eagle.process()

async function process(pcm: Int16Array): Promise<number[]>

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.

Eagle.reset()

async function reset(): Promise<void>

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.release()

async function release(): Promise<void>

Releases resources acquired by Eagle.


Eagle.frameLength

get frameLength(): number

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


Eagle.sampleRate

get sampleRate(): number

Audio sample rate accepted by Eagle.


Eagle.version

get version(): string

Version of Eagle.


EagleModel

type EagleModel = {
base64?: string;
publicPath?: string;
customWritePath?: string;
forceWrite?: boolean;
version?: number;
}

Eagle model type.

  • base64 string: The model file (.pv) in base64 string to initialize Koala.
  • publicPath string: The model file (.pv) path relative to the public directory.
  • customWritePath string : Custom path to save the model in storage. Set to a different name to use multiple models across Eagle instances.
  • forceWrite boolean : Flag to overwrite the model in storage even if it exists.
  • version number : Version of the model file. Increment to update the model file in storage.

EagleProfile

type EagleProfile = {
bytes: Uint8Array;
}

Eagle speaker profile. Can be created by calling .export() after a successful speaker enrollment.

  • bytes Uint8Array: Binary array containing the Eagle speaker profile.

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.create()

static async function create(
accessKey: string,
model: EagleModel
): Promise<EagleProfiler>

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

Parameters

  • accessKey string : AccessKey obtained from Picovoice Console.
  • model EagleModel : Eagle model options.

Returns

  • EagleProfiler : An instance of the EagleProfiler.

EagleProfiler.enroll()

async function enroll(pcm: Int16Array): Promise<EagleProfilerEnrollResult>

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

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

EagleProfiler.export()

async function export(): Promise<EagleProfile>

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

Returns

  • EagleProfile : The Eagle speaker profile.

EagleProfiler.reset()

async function reset(): Promise<void>

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


EagleProfiler.release()

async function release(): Promise<void>

Releases resources acquired by Eagle Profiler.


EagleProfiler.minEnrollSamples

get minEnrollSamples(): number

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


EagleProfiler.sampleRate

get sampleRate(): number

Audio sample rate accepted by Eagle.


EagleProfiler.version

get version(): string

Version of Eagle.


EagleProfilerEnrollFeedback

enum EagleProfilerEnrollFeedback {
AUDIO_OK = 0,
AUDIO_TOO_SHORT,
UNKNOWN_SPEAKER,
NO_VOICE_FOUND,
QUALITY_ISSUE,
}
  • AUDIO_OK: 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.

EagleProfilerEnrollResult

type EagleProfilerEnrollResult = {
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.

EagleProfilerWorker

class EagleProfilerWorker {}

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


EagleProfilerWorker.create()

static async function create(
accessKey: string,
model: EagleModel
): Promise<EagleProfilerWorker>

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

Parameters

  • accessKey string : AccessKey obtained from Picovoice Console.
  • model EagleModel : Eagle model options.

Returns

  • EagleProfilerWorker : An instance of the EagleProfilerWorker.

EagleProfilerWorker.enroll()

async function enroll(pcm: Int16Array): Promise<EagleProfilerEnrollResult>

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. EagleProfilerWorker operates on single-channel audio.

Returns

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

EagleProfilerWorker.export()

async function export(): Promise<EagleProfile>

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

Returns

  • EagleProfile : The Eagle speaker profile.

EagleProfilerWorker.reset()

async function reset(): Promise<void>

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


EagleProfilerWorker.release()

async function release(): Promise<void>

Releases resources acquired by Eagle Profiler.


EagleProfilerWorker.terminate()

async function terminate(): Promise<void>

Force terminates the instance of EagleProfilerWorker.


EagleProfilerWorker.minEnrollSamples

get minEnrollSamples(): number

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


EagleProfilerWorker.sampleRate

get sampleRate(): number

Audio sample rate accepted by Eagle.


EagleProfilerWorker.version

get version(): string

Version of Eagle.


EagleWorker

class EagleWorker {}

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


EagleWorker.create()

static async function create(
accessKey: string,
model: EagleModel,
speakerProfiles: EagleProfile[] | EagleProfile
): Promise<EagleProfiler>

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

Parameters

  • accessKey string : AccessKey obtained from Picovoice Console.
  • model EagleModel : Eagle model options.
  • speakerProfiles EagleProfile[] | EagleProfile : One or more Eagle speaker profiles. These can be constructed using EagleProfiler.

Returns

  • EagleWorker : An instance of the EagleWorker.

EagleWorker.process()

async function process(pcm: Int16Array): Promise<number[]>

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.

EagleWorker.reset()

async function reset(): Promise<void>

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.


EagleWorker.release()

async function release(): Promise<void>

Releases resources acquired by EagleWorker


EagleWorker.terminate()

async function terminate(): Promise<void>

Force terminates the instance of EagleWorker.


EagleWorker.frameLength

get frameLength(): number

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


EagleWorker.sampleRate

get sampleRate(): number

Audio sample rate accepted by Eagle.


EagleWorker.version

get version(): string

Version of Eagle.

Was this doc helpful?

Issue with this doc?

Report a GitHub Issue
Eagle Speaker Recognition Web API
  • Eagle
  • create()
  • process()
  • reset()
  • release()
  • frameLength
  • sampleRate
  • version
  • EagleModel
  • EagleProfile
  • EagleProfiler
  • create()
  • enroll()
  • export()
  • reset()
  • release()
  • minEnrollSamples
  • sampleRate
  • version
  • EagleProfilerEnrollFeedback
  • EagleProfilerEnrollResult
  • EagleProfilerWorker
  • create()
  • enroll()
  • export()
  • reset()
  • release()
  • terminate()
  • minEnrollSamples
  • sampleRate
  • version
  • EagleWorker
  • create()
  • process()
  • reset()
  • release()
  • terminate()
  • frameLength
  • sampleRate
  • version
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.