Class AfpGenerator

  • All Implemented Interfaces:

    
    public final class AfpGenerator
    
                        

    AfpGenerator 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.

    • 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.
      • startGen

         final Unit startGen()

        Starts AFP generation from the microphone.

      • stopGen

         final Unit stopGen()

        Stops AFP generation and releases resources.