Picovoice Wordmark
Start Free
Introduction
Introduction
AndroidC.NETiOSLinuxmacOSNode.jsPythonRaspberry PiWebWindows
AndroidC.NETiOSNode.jsPythonWeb
SummaryPicovoice picoLLMGPTQ
Introduction
AndroidCiOSLinuxmacOSPythonRaspberry PiWebWindows
AndroidCiOSPythonWeb
Introduction
AndroidC.NETFlutteriOSJavaLinuxmacOSNode.jsPythonRaspberry PiReactReact NativeWebWindows
AndroidC.NETFlutteriOSJavaNode.jsPythonReactReact NativeWeb
SummaryPicovoice LeopardAmazon TranscribeAzure Speech-to-TextGoogle ASRGoogle ASR (Enhanced)IBM Watson Speech-to-TextWhisper Speech-to-Text
FAQ
Introduction
AndroidC.NETFlutteriOSJavaLinuxmacOSNode.jsPythonRaspberry PiReactReact NativeWebWindows
AndroidC.NETFlutteriOSJavaNode.jsPythonReactReact NativeWeb
SummaryPicovoice CheetahAzure Real-Time Speech-to-TextAmazon Transcribe StreamingGoogle Streaming ASRMoonshine StreamingVosk StreamingWhisper.cpp Streaming
FAQ
Introduction
AndroidC.NETiOSLinuxmacOSNode.jsPythonRaspberry PiWebWindows
AndroidC.NETiOSNode.jsPythonWeb
SummaryAmazon PollyAzure TTSElevenLabsOpenAI TTSPicovoice OrcaChatterbox-TTS-TurboKokoro-TTSKitten-TTS-Nano-0.8-INT8Pocket-TTSNeu-TTS-Nano-Q4-GGUFPiper-TTSSoprano-TTSSupertonic-TTS-2ESpeak-NG
Introduction
AndroidCiOSLinuxmacOSPythonRaspberry PiWebWindows
AndroidCiOSPythonWeb
SummaryPicovoice KoalaMozilla RNNoise
Introduction
AndroidCiOSLinuxmacOSNode.jsPythonRaspberry PiWebWindows
AndroidCNode.jsPythoniOSWeb
SummaryPicovoice EaglepyannoteSpeechBrain
Introduction
AndroidCiOSLinuxmacOSPythonRaspberry PiWebWindows
AndroidCiOSPythonWeb
SummaryPicovoice FalconAmazon TranscribeAzure Speech-to-TextGoogle Speech-to-Textpyannote
Introduction
AndroidArduinoCChrome.NETEdgeFirefoxFlutteriOSJavaLinuxmacOSMicrocontrollerNode.jsPythonRaspberry PiReactReact NativeSafariWebWindows
AndroidC.NETFlutteriOSJavaMicrocontrollerNode.jsPythonReactReact NativeWeb
SummaryPicovoice PorcupineSnowboyPocketSphinx
Wake Word TipsFAQ
Introduction
AndroidArduinoCChrome.NETEdgeFirefoxFlutteriOSJavaLinuxmacOSMicrocontrollerNode.jsPythonRaspberry PiReactReact NativeSafariWebWindows
AndroidC.NETFlutteriOSJavaMicrocontrollerNode.jsPythonReactReact NativeWeb
SummaryPicovoice RhinoGoogle DialogflowAmazon LexIBM WatsonMicrosoft LUIS
Expression SyntaxFAQ
Introduction
AndroidArduinoC.NETiOSLinuxmacOSMicrocontrollerNode.jsPythonRaspberry PiWebWindows
AndroidC.NETiOSMicrocontrollerNode.jsPythonWeb
SummaryPicovoice CobraWebRTC VADSilero VAD
FAQ
Introduction
AndroidCiOSLinuxmacOSPythonRaspberry PiWebWindows
AndroidCiOSPythonWeb
Introduction
AndroidC.NETFlutteriOSNode.jsPythonReact NativeWeb
AndroidC.NETFlutteriOSNode.jsPythonReact NativeWeb
Introduction
C.NETNode.jsPython
C.NETNode.jsPython
FAQGlossary

Eagle Speaker Recognition
Android API

API Reference for the Android Eagle SDK (eagle-android)

package: ai.picovoice.eagle


Eagle

public class Eagle { }

Class for the Eagle speaker recognition engine.

Eagle must be initialized using the Eagle.Builder Class. Resources should be cleaned when you are done using the delete() function.


Eagle.delete()

public void delete()

Releases resources acquired by Eagle.


Eagle.getAvailableDevices()

public static String[] getAvailableDevices() throws EagleException

Lists all available devices that Eagle can use for inference. Each entry in the list can be used as the device argument when initializing Eagle.

Returns

  • String[]: Array of all available devices that Eagle can be used for inference.

Throws

  • EagleException: If an error occurs while getting available devices.

Eagle.getMinProcessSamples()

public int getMinProcessSamples()

Getter for minimum length of the input pcm required by .process().

Returns

  • int: minimum length of the input pcm.

Eagle.getSampleRate()

public void getSampleRate()

Getter for required audio sample rate for PCM data.

Returns

  • int: Required audio sample rate for PCM data.

Eagle.getVersion()

public String getVersion()

Getter for version.

Returns

  • String: Current Eagle version.

Eagle.process()

public float[] process(short[] pcm, EagleProfile[] speakerProfiles) throws EagleException

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

Parameters

  • pcm short[] : A frame of audio samples. The minimum number of samples per frame can be attained by calling .getMinProcessSamples(). The incoming audio needs to have a sample rate equal to .getSmapleRate and be 16-bit linearly-encoded. Eagle operates on single-channel audio.'
  • speakerProfiles EagleProfile[] : Array of speaker profiles created with EagleProfiler.

Returns

  • float[] | null: A list of similarity scores for each speaker profile or null. A higher score indicates that the voice belongs to the corresponding speaker. The range is [0, 1] with 1 representing a perfect match. A result of null indicates that there was not enough voice in the audio to recognize any speakers.

Throws

  • EagleException: If there is an error while processing the audio frame.

Eagle.Builder

public static class Builder { }

Builder for creating an instance of Eagle with a mixture of default arguments.


Eagle.Builder.build()

public Eagle build(Context context) throws EagleException

Creates an instance of Eagle speaker recognition engine.

Parameters

  • context Context : The Android app context.

Returns

  • Eagle: An instance of Eagle speaker recognition engine.

Throws

  • EagleException: If an error occurs while creating an instance of Eagle speaker recognition engine.

Eagle.Builder.setAccessKey()

public Eagle.Builder setAccessKey(String accessKey)

Sets the AccessKey of the builder.

Parameters

  • accessKey String : AccessKey obtained from Picovoice Console.

Returns

  • Eagle.Builder: Modified Eagle.Builder object.

Eagle.Builder.setModelPath()

public Eagle.Builder setModelPath(String modelPath)

Sets the model path of the builder.

Parameters

  • modelPath String : Path to the file containing model parameters (.pv). Can be either a path that is relative to the project's assets folder or an absolute path to the file on device.

Returns

  • Eagle.Builder: Modified Eagle.Builder object.

Eagle.Builder.setDevice()

public Eagle.Builder setDevice(String device)

Sets the device of the builder. If not set it will be set to the default device best.

Parameters

  • device String : String representation of the device (e.g., CPU or GPU) to use for inference. If set to best, the most suitable device is selected automatically. If set to gpu, the engine uses the first available GPU device. To select a specific GPU device, set this argument to gpu:${GPU_INDEX}, where ${GPU_INDEX} is the index of the target GPU. If set to cpu, the engine will run on the CPU with the default number of threads. To specify the number of threads, set this argument to cpu:${NUM_THREADS}, where ${NUM_THREADS} is the desired number of threads.

Returns

  • Eagle.Builder: Modified Eagle.Builder object.

Eagle.Builder.setVoiceThreshold()

public Eagle.Builder setVoiceThreshold(float voiceThreshold)

Sets the voice threshold of the builder.

Parameters

  • voiceThreshold float : Sensitivity threshold for detecting voice. The value should be a number within [0, 1]. A higher threshold increases detection confidence values at the cost of potentially missing frames of voice.

Returns

  • Eagle.Builder: Modified Eagle.Builder object.

EagleException

public class EagleException extends Exception { }

Exception thrown if an error occurs within Eagle speaker recognition engine.

Exceptions:

public class EagleActivationException extends EagleException { }
public class EagleActivationLimitException extends EagleException { }
public class EagleActivationRefusedException extends EagleException { }
public class EagleActivationThrottledException extends EagleException { }
public class EagleIOException extends EagleException { }
public class EagleInvalidArgumentException extends EagleException { }
public class EagleInvalidStateException extends EagleException { }
public class EagleKeyException extends EagleException { }
public class EagleMemoryException extends EagleException { }
public class EagleRuntimeException extends EagleException { }
public class EagleStopIterationException extends EagleException { }

EagleProfile

public class EagleProfile {
public EagleProfile(byte[] profileBytes) { }
}

Type which represents a speaker profile. The object can be serialized (via .getBytes()) and deserialized (via constructor) for reuse. Resources must explicitly be released by calling .delete().

Parameters

  • metadataBytes byte[] : A byte array previously obtained via .getBytes().

EagleProfile.getBytes()

public byte[] getBytes()

Gets the metadata in the form of a byte array.

Returns

  • byte[]: The metadata in the form of a byte array.

EagleProfile.delete()

public void delete()

Releases resources acquired by EagleProfile.


EagleProfiler

public class EagleProfiler { }

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


EagleProfiler.delete()

public void delete()

Releases resources acquired by EagleProfiler.


EagleProfiler.getAvailableDevices()

public static String[] getAvailableDevices() throws EagleException

Lists all available devices that EagleProfiler can use for inference. Each entry in the list can be used as the device argument when initializing EagleProfiler.

Returns

  • String[]: Array of all available devices that EagleProfiler can be used for inference.

Throws

  • EagleException: If an error occurs while getting available devices.

EagleProfiler.getFrameLength()

public int getFrameLength()

Getter for number of audio samples per frame.

Returns

  • int: Number of audio samples per frame.

EagleProfiler.getSampleRate()

public void getSampleRate()

Getter for required audio sample rate for PCM data.

Returns

  • int: Required audio sample rate for PCM data.

EagleProfiler.getVersion()

public String getVersion()

Getter for version.

Returns

  • String: Current Eagle version.

EagleProfiler.enroll()

public float enroll(short[] pcm) throws EagleException

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 .getFrameLength(). 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 .getSampleRate() and be 16-bit linearly-encoded. EagleProfiler operates on single-channel audio.

Returns

  • float : The percentage of enrollment completed.

Throws

  • EagleException: If an error occurs while enrolling speaker.

EagleProfiler.flush()

public float flush() throws EagleException

Marks the end of the audio stream, flushes internal state of the object, and returns the percentage of enrollment completed.

Returns

  • float : The percentage of enrollment completed.

Throws

  • EagleException: If an error occurs while enrolling speaker.

EagleProfiler.export()

public EagleProfile export() throws EagleException

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

  • EagleException: If an error occurs while exporting speaker.

EagleProfiler.reset()

public void reset() throws EagleException

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

Throws

  • EagleException: If an error occurs while resetting speaker.

EagleProfiler.Builder

public static class Builder { }

Builder for creating an instance of the EagleProfiler with a mixture of default arguments.


EagleProfiler.Builder.build()

public EagleProfiler build(Context context) throws EagleException

Creates an instance of the EagleProfiler.

Parameters

  • context Context : The Android app context.

Returns

  • EagleProfiler: An instance of the EagleProfiler.

Throws

  • EagleException: If an error occurs while creating an instance of the EagleProfiler.

EagleProfiler.Builder.setAccessKey()

public EagleProfiler.Builder setAccessKey(String accessKey)

Sets the AccessKey of the builder.

Parameters

  • accessKey String : AccessKey obtained from Picovoice Console.

Returns

  • EagleProfiler.Builder: Modified EagleProfiler.Builder object.

EagleProfiler.Builder.setModelPath()

public EagleProfiler.Builder setModelPath(String modelPath)

Sets the model path of the builder.

Parameters

  • modelPath String : Path to the file containing model parameters (.pv). Can be either a path that is relative to the project's assets folder or an absolute path to the file on device.

Returns

  • EagleProfiler.Builder: Modified EagleProfiler.Builder object.

EagleProfiler.Builder.setDevice()

public EagleProfiler.Builder setDevice(String device)

Sets the device of the builder. If not set it will be set to the default device best.

Parameters

  • device String : String representation of the device (e.g., CPU or GPU) to use for inference. If set to best, the most suitable device is selected automatically. If set to gpu, the engine uses the first available GPU device. To select a specific GPU device, set this argument to gpu:${GPU_INDEX}, where ${GPU_INDEX} is the index of the target GPU. If set to cpu, the engine will run on the CPU with the default number of threads. To specify the number of threads, set this argument to cpu:${NUM_THREADS}, where ${NUM_THREADS} is the desired number of threads.

Returns

  • EagleProfiler.Builder: Modified EagleProfiler.Builder object.

EagleProfiler.Builder.setMinEnrollmentChunks()

public EagleProfiler.Builder setMinEnrollmentChunks(int minEnrollmentChunks)

Sets the min enrollment chunks of the builder.

Parameters

  • minEnrollmentChunks int : Minimum number of chunks to be processed before enroll returns 100%. The value should be a number greater than or equal to 1. A higher number results in more accurate profiles at the cost of needing more data to create the profile.

Returns

  • EagleProfiler.Builder: Modified EagleProfiler.Builder object.

EagleProfiler.Builder.setVoiceThreshold()

public EagleProfiler.Builder setVoiceThreshold(float voiceThreshold)

Sets the voice threshold of the builder.

Parameters

  • voiceThreshold float : Sensitivity threshold for detecting voice. The value should be a number within [0, 1]. A higher threshold increases detection confidence values at the cost of potentially missing frames of voice.

Returns

  • EagleProfiler.Builder: Modified EagleProfiler.Builder object.

Was this doc helpful?

Issue with this doc?

Report a GitHub Issue
Eagle Speaker Recognition Android API
  • Eagle
  • delete()
  • getAvailableDevices()
  • getMinProcessSamples()
  • getSampleRate()
  • getVersion()
  • process()
  • Eagle.Builder
  • build()
  • setAccessKey()
  • setModelPath()
  • setDevice()
  • setVoiceThreshold()
  • EagleException
  • EagleProfile
  • getBytes()
  • delete()
  • EagleProfiler
  • delete()
  • getAvailableDevices()
  • getFrameLength()
  • getSampleRate()
  • getVersion()
  • enroll()
  • flush()
  • export()
  • reset()
  • EagleProfiler.Builder
  • build()
  • setAccessKey()
  • setModelPath()
  • setDevice()
  • setMinEnrollmentChunks()
  • setVoiceThreshold()
© 2019-2026 Picovoice Inc.PrivacyTerms