Package com.iplateia.afplib
Class AfpGenerator
-
- All Implemented Interfaces:
public final class AfpGeneratorAfpGenerator is responsible for handling audio recording from the microphone, and generating AFP (Audio Fingerprint) data.
This class manages the lifecycle of audio recording, including starting and stopping the recording process, buffering audio data, detecting silence, and invoking callbacks to notify listeners of recording events and AFP generation results.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classAfpGenerator.MicAcquireFailedExceptionException for microphone acquisition failure.
-
Field Summary
Fields Modifier and Type Field Description public final static IntegerHOP_PER_SECpublic final static IntegerLEVEL_COUNT
-
Constructor Summary
Constructors Constructor Description AfpGenerator(AfpGeneratorListener listener)
-
Method Summary
Modifier and Type Method Description final UnitsetAudioParams(Integer rate, Integer nchannels, Integer nsamplebytes)Sets audio parameters for recording. final UnitsetRecordingDuration(Double sec)Sets the recording duration in seconds. final UnitsetRecordingInterval(Double sec)Sets the recording interval in seconds. final UnitsetSilenceRate(Double sr)Sets the silence rate threshold. final UnitsetSilenceThreshold(Double st)Sets the silence threshold value. final UnitstartGen()Starts AFP generation from the microphone. final UnitstopGen()Stops AFP generation and releases resources. -
-
Constructor Detail
-
AfpGenerator
AfpGenerator(AfpGeneratorListener listener)
-
-
Method Detail
-
setAudioParams
final Unit setAudioParams(Integer rate, Integer nchannels, Integer nsamplebytes)
Sets audio parameters for recording.
- Parameters:
rate- The sample rate in Hz.nchannels- The number of audio channels.nsamplebytes- The number of bytes per audio sample.
-
setRecordingDuration
final Unit setRecordingDuration(Double sec)
Sets the recording duration in seconds.
- Parameters:
sec- The duration in seconds.
-
setRecordingInterval
final Unit setRecordingInterval(Double sec)
Sets the recording interval in seconds.
- Parameters:
sec- The interval in seconds.
-
setSilenceRate
final Unit setSilenceRate(Double sr)
Sets the silence rate threshold.
- Parameters:
sr- The silence rate threshold.
-
setSilenceThreshold
final Unit setSilenceThreshold(Double st)
Sets the silence threshold value.
- Parameters:
st- The silence threshold value.
-
-
-
-