Eagle Speaker Recognition
iOS API
API Reference for the Eagle iOS SDK (Cocoapods)
EagleProfiler
Profiler class for the Eagle speaker recognition engine.
EagleProfiler.getAvailableDevices()
Retrieves a list of devices that can be specified when constructing EagleProfiler.
Returns
- [String] : An array of available devices.
Throws
EagleError: If an error occurs while retrieving the devices.
EagleProfiler.init()
Constructor for the EagleProfiler class
Parameters
accessKeyString : The AccessKey obtained from Picovoice Console.modelPathString? : Absolute path to file containing model parameters (.pv).deviceString? : String representation of the device (e.g., CPU or GPU) to use. If set tobest, the most suitable device is selected automatically. If set togpu, the engine uses the first available GPU device. To select a specific GPU device, set this argument togpu:${GPU_INDEX}, where${GPU_INDEX}is the index of the target GPU. If set tocpu, the engine will run on the CPU with the default number of threads. To specify the number of threads, set this argument tocpu:${NUM_THREADS}, where${NUM_THREADS}is the desired number of threads.
Throws
EagleError: If an error occurs while creating an instance of EagleProfiler.
EagleProfiler.delete()
Releases resources acquired by EagleProfiler.
EagleProfiler.enroll()
Enrolls a speaker.
Parameters
pcm[Int16] : An array of audio samples. The audio needs to have a sample rate equal to.sampleRateand be single-channel, 16-bit linearly-encoded. In addition it must be at leastminEnrollSamples()samples long.
Returns
(Float,EagleProfilerEnrollFeedback): A tuple containing a the percentage of enrollment completed and anEagleProfilerEnrollFeedbackenum representing the feedback code.
Throws
EagleError: If an error occurs while processing the pcm array.
EagleProfiler.export()
Exports the speaker profile. The exported profile can be used in Eagle or stored for later use.
Returns
EagleProfile: AnEagleProfileobject.
Throws
EagleError: If an error occurs while exporting the speaker profile.
EagleProfiler.reset()
Resets EagleProfiler and removes all enrollment data. It must be called before enrolling a new speaker.
Throws
EagleError: If an error occurs while exporting the speaker profile.
EagleProfiler.minEnrollSamples()
Getter for the minimum length of the input pcm required by enroll().
Returns
Int: Minimum number of samples required for a call toenroll().
Throws
EagleError: If an error occurs.
EagleProfiler.sampleRate
The audio sample rate that EagleProfiler accepts.
EagleProfiler.version
EagleProfiler version string.
EagleProfile
The class representing a speaker profile after enrollment by EagleProfiler. Returned by EagleProfiler.export().
EagleProfile.init()
Constructor.
Parameters
profileBytes[UInt8] : A byte array that was previously obtained viagetBytes().
EagleProfile.getBytes()
Gets a binary representation of the profile.
Returns
[UInt8]: A byte array of the profile.
EagleProfilerEnrollFeedback
A enum representing the enrollment feedback.
Eagle
Recognizer class for the Eagle speaker recognition engine.
Eagle.getAvailableDevices()
Retrieves a list of devices that can be specified when constructing Eagle.
Returns
- [String] : An array of available devices.
Throws
EagleError: If an error occurs while retrieving the devices.
Eagle.init()
Constructors for the Eagle class
Parameters
accessKeyString : The AccessKey obtained from Picovoice Console.speakerProfiles[EagleProfile] : An array ofEagleProfileobjects obtained fromEagleProfiler.modelPathString? : Absolute path to file containing model parameters (.pv).deviceString? : String representation of the device (e.g., CPU or GPU) to use. If set tobest, the most suitable device is selected automatically. If set togpu, the engine uses the first available GPU device. To select a specific GPU device, set this argument togpu:${GPU_INDEX}, where${GPU_INDEX}is the index of the target GPU. If set tocpu, the engine will run on the CPU with the default number of threads. To specify the number of threads, set this argument tocpu:${NUM_THREADS}, where${NUM_THREADS}is the desired number of threads.
Throws
EagleError: If an error occurs while creating an instance of Eagle.
Parameters
accessKeyString : The AccessKey obtained from Picovoice Console.speakerProfileEagleProfile : AnEagleProfileobject obtained fromEagleProfiler.modelPathString? : Absolute path to file containing model parameters (.pv).deviceString? : String representation of the device (e.g., CPU or GPU) to use. If set tobest, the most suitable device is selected automatically. If set togpu, the engine uses the first available GPU device. To select a specific GPU device, set this argument togpu:${GPU_INDEX}, where${GPU_INDEX}is the index of the target GPU. If set tocpu, the engine will run on the CPU with the default number of threads. To specify the number of threads, set this argument tocpu:${NUM_THREADS}, where${NUM_THREADS}is the desired number of threads.
Throws
EagleError: If an error occurs while creating an instance of Eagle.
Eagle.delete()
Releases resources acquired by Eagle.
Eagle.process()
Processes given audio data and returns speaker likelihood scores.
Parameters
pcm[Int16] : An array of audio samples. The audio needs to have a sample rate equal to.sampleRateand be single-channel, 16-bit linearly-encoded. In addition it must be exactly.frameLengthsamples long.
Returns
[Float]: Similarity scores for each enrolled speaker. The scores are in the range [0, 1] with 1 being a perfect match.
Throws
EagleError: If an error occurs while processing the pcm array.
Eagle.reset()
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.
Throws
EagleError: If an error occurs while resetting.
Eagle.frameLength
The audio frame length in PCM samples that Eagle accepts.
Eagle.sampleRate
The audio sample rate that Eagle accepts.
Eagle.version
Eagle version string.
EagleError
Error type thrown by the Eagle iOS SDK.