Eagle Speaker Recognition
iOS API
API Reference for the Eagle iOS SDK (Cocoapods)
EagleProfiler
Profiler class for the Eagle speaker recognition engine.
EagleProfiler.init()
Constructor for the EagleProfiler class
Parameters
accessKeyString : The AccessKey obtained from Picovoice Console.modelPathString? : Absolute path to file containing model parameters (.pv).
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.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).
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).
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.