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

API Reference for the Python Eagle SDK (PyPI).


pveagle.create_profiler()

def create_profiler(
access_key: str,
model_path: Optional[str] = None,
library_path: Optional[str] = None) -> EagleProfiler:

Factory method for the profiler component of the Eagle speaker recognition engine.

Parameters

  • access_key str : AccessKey obtained from Picovoice Console.
  • model_path Optional[str] : Absolute path to the file containing model parameters.
  • library_path Optional[str] : Absolute path to Eagle's dynamic library.

Returns

  • EagleProfiler: An instance of EagleProfiler object.

Throws

  • EagleError

pveagle.create_recognizer()

def create_recognizer(
access_key: str,
speaker_profiles: Union[Sequence[EagleProfile], EagleProfile],
model_path: Optional[str] = None,
library_path: Optional[str] = None) -> Eagle:

Factory method for the recognizer component of the Eagle speaker recognition engine.

Parameters

  • access_key str : AccessKey obtained from Picovoice Console.
  • speaker_profiles Union[Sequence[EagleProfile], EagleProfile] : An instance of EagleProfiler or a list of EagleProfiler instances. Each profile corresponds to a speaker enrolled in the system.
  • model_path Optional[str] : Absolute path to the file containing model parameters.
  • library_path Optional[str] : Absolute path to Eagle's dynamic library.

Returns

  • Eagle: An instance of Eagle object.

Throws

  • EagleError

pveagle.EagleProfiler

class EagleProfiler(object)

Class for the profiler component of the Eagle speaker recognition engine.

EagleProfiler can be initialized either using the module level create_profiler() function or directly using the class __init__() method. Resources should be cleaned when you are done using the delete() method.


pveagle.EagleProfiler.__init__()

def __init__(
self,
access_key: str,
model_path: str,
library_path: str) -> None:

__init__ method for the profiler component of the Eagle speaker recognition engine.

Parameters

  • access_key str : AccessKey obtained from Picovoice Console.
  • model_path str : Absolute path to the file containing model parameters.
  • library_path str : Absolute path to Eagle's dynamic library.

Returns

  • EagleProfiler: An instance of EagleProfiler object.

Throws

  • EagleError

pveagle.EagleProfiler.enroll()

def enroll(self, pcm: Sequence[int]) -> Tuple[float, EagleProfilerEnrollFeedback]:

Enrolls a speaker. This function should be called multiple times with different utterances of the same speaker until the enrollment 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 .min_enroll_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
  • 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 Sequence[int] : Audio data. The audio needs to have a sample rate equal to .sample_rate and be 16-bit linearly-encoded. EagleProfiler operates on single-channel audio.

Returns

  • Tuple[float, EagleProfilerEnrollFeedback] : The percentage of completeness of the speaker enrollment process along with the feedback code corresponding to the last enrollment attempt.

Throws

  • EagleError

pveagle.EagleProfiler.export()

def export(self) -> EagleProfile:

Exports the speaker profile of the current session. Will raise an exception if the profile is not ready.

Returns

  • EagleProfile: An immutable EagleProfile object representing the enrolled speaker.

Throws

  • EagleError

pveagle.EagleProfiler.reset()

def reset(self) -> None:

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

Throws

  • EagleError

pveagle.EagleProfiler.delete()

def delete(self) -> None:

Releases resources acquired by EagleProfiler.


pveagle.EagleProfiler.min_enroll_samples

self.min_enroll_samples: int

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


pveagle.EagleProfiler.sample_rate

self.sample_rate: int

Audio sample rate accepted by .enroll().


pveagle.EagleProfiler.version

self.version: str

The version string of the Eagle library.


pveagle.EagleProfile

class EagleProfile(object)

Python representation of an Eagle speaker profile.


pveagle.EagleProfile.from_bytes()

def from_bytes(cls, profile: bytes) -> 'EagleProfile'

Creates an instance of EagleProfile from a bytes object.

Parameters

  • profile bytes : A bytes object containing the profile.

Returns

  • EagleProfile: An instance of EagleProfile object.

pveagle.EagleProfile.to_bytes()

def to_bytes(self) -> bytes

Converts the profile to a bytes object.

Returns

  • bytes : The profile as a bytes object.

pveagle.EagleProfile.size

self.size: int

The size of the profile in bytes.


pveagle.EagleProfilerEnrollFeedback

class EagleProfilerEnrollFeedback(Enum):

Enumeration of possible enrollment feedback codes.

Members

  • 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.

pveagle.Eagle

class Eagle(object)

Class for the recognizer component of the Eagle speaker recognition engine.

Eagle can be initialized either using the module level create_recognizer() function or directly using the class __init__() method. Resources should be cleaned when you are done using the delete() method.


pveagle.Eagle.__init__()

def __init__(
self,
access_key: str,
model_path: str,
library_path: str,
speaker_profiles: Sequence[EagleProfile]) -> None:

__init__ method for the recognizer component of the Eagle speaker recognition engine.

Parameters

  • access_key str : AccessKey obtained from Picovoice Console.
  • model_path str : Absolute path to the file containing model parameters.
  • library_path str : Absolute path to Eagle's dynamic library.
  • speaker_profiles Sequence[EagleProfile] : A list of EagleProfile objects. This can be constructed using EagleProfiler.

Returns

  • Eagle: An instance of Eagle object.

Throws

  • EagleError

pveagle.Eagle.process()

def process(self, pcm: Sequence[int]) -> Sequence[float]:

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

Parameters

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

Returns

  • Sequence[float] : 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.

Throws

  • EagleError

pveagle.Eagle.reset()

def reset(self) -> None:

Resets the internal state of the engine. It must be called before processing a new sequence of audio frames.

Throws

  • EagleError

pveagle.Eagle.delete()

def delete(self) -> None:

Releases resources acquired by Eagle.

Throws

  • EagleError

pveagle.Eagle.sample_rate

self.sample_rate: int

Audio sample rate accepted by Eagle.


pveagle.Eagle.frame_length

self.frame_length: int

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


pveagle.Eagle.version

self.version: str

The version string of the Eagle library.


pveagle.EagleError

class EagleError(Exception)

Error thrown if an error occurs within Eagle Speaker Recognition Engine.

Exceptions

class EagleActivationError(EagleError)
class EagleActivationLimitError(EagleError)
class EagleActivationRefusedError(EagleError)
class EagleActivationThrottledError(EagleError)
class EagleIOError(EagleError)
class EagleInvalidArgumentError(EagleError)
class EagleInvalidStateError(EagleError)
class EagleKeyError(EagleError)
class EagleMemoryError(EagleError)
class EagleRuntimeError(EagleError)
class EagleStopIterationError(EagleError)

Was this doc helpful?

Issue with this doc?

Report a GitHub Issue
Eagle Speaker Recognition Python API
  • pveagle.create_profiler()
  • pveagle.create_recognizer()
  • pveagle.EagleProfiler
  • __init__()
  • enroll()
  • export()
  • reset()
  • delete()
  • min_enroll_samples
  • sample_rate
  • version
  • pveagle.EagleProfile
  • from_bytes()
  • to_bytes()
  • size
  • pveagle.EagleProfilerEnrollFeedback
  • pveagle.Eagle
  • __init__()
  • process()
  • reset()
  • delete()
  • sample_rate
  • frame_length
  • version
  • pveagle.EagleError
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.