Package ai.picovoice.eagle
Class EagleProfiler
- java.lang.Object
-
- ai.picovoice.eagle.EagleProfiler
-
public class EagleProfiler extends java.lang.ObjectAndroid binding for the profiler of the Eagle speaker recognition engine. It enrolls a speaker given a set of utterances and then constructs a profile for the enrolled speaker.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classEagleProfiler.BuilderBuilder for creating instance of EagleProfiler.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddelete()Releases resources acquired by Eagle.EagleProfilerEnrollResultenroll(short[] pcm)Enrolls a speaker.EagleProfileexport()Exports the speaker profile of the current session.intgetMinEnrollSamples()Getter for minimum length of the input pcm required by `.enroll()`.intgetSampleRate()Getter for audio sample rate accepted by Picovoice.java.lang.StringgetVersion()Getter for version.voidreset()Resets the internal state of Eagle Profiler.static voidsetSdk(java.lang.String sdk)
-
-
-
Method Detail
-
setSdk
public static void setSdk(java.lang.String sdk)
-
delete
public void delete()
Releases resources acquired by Eagle.
-
enroll
public EagleProfilerEnrollResult enroll(short[] pcm) throws EagleException
Enrolls a speaker. This function should be called multiple times with different utterances of the same speaker until `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 `.getMinEnrollSamples()`. 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- The audio needs to have a sample rate equal to `.getSampleRate()` and be 16-bit linearly-encoded. EagleProfiler operates on single-channel audio.- Returns:
- The percentage of completeness of the speaker enrollment process along with the feedback code corresponding to the last enrollment attempt.
- Throws:
EagleException- if there is an error while enrolling speaker.
-
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:
- An EagleProfile object.
- Throws:
EagleException
-
reset
public void reset() throws EagleExceptionResets the internal state of Eagle Profiler. It should be called before starting a new enrollment session.- Throws:
EagleException
-
getVersion
public java.lang.String getVersion()
Getter for version.- Returns:
- Version.
-
getSampleRate
public int getSampleRate()
Getter for audio sample rate accepted by Picovoice.- Returns:
- Audio sample rate accepted by Picovoice.
-
getMinEnrollSamples
public int getMinEnrollSamples()
Getter for minimum length of the input pcm required by `.enroll()`.- Returns:
- minimum length of the input pcm.
-
-