Class AfpMatcher

  • All Implemented Interfaces:

    
    public final class AfpMatcher
    
                        

    AfpMatcher is a class that handles audio fingerprint matching. It uses the AfpGenerator to generate audio fingerprints and matches them against an AudioDB. It also manages the state of the matching process and handles errors.

    The handler should be implemented to process messages from the AfpMatcher.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private final volatile Boolean running
    • Constructor Summary

      Constructors 
      Constructor Description
      AfpMatcher(Service service, Handler handler) Creates an instance of AfpMatcher.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Constructor Detail

      • AfpMatcher

        AfpMatcher(Service service, Handler handler)
        Creates an instance of AfpMatcher.
        Parameters:
        service - The service context.
        handler - The handler to process messages.
    • Method Detail

      • setAudioDB

         final Unit setAudioDB(AudioDB adb)

        Set AudioDB instance. Replacing the AudioDB while the AfpMatcher is running may cause issues.

      • getAudioDB

         final AudioDB getAudioDB()

        Get current AudioDB instance. It's same as directly accessing the audioDB property.

      • loadAudioPack

         final <Error class: unknown class> loadAudioPack(String path)

        Load audio pack from filesystem.

        Parameters:
        path - The name of the file to load.
      • stopCapture

         final <Error class: unknown class> stopCapture()

        Stop audio capture mode.

      • setAudioParams

         final <Error class: unknown class> setAudioParams(Integer rate, Integer nchannels, Integer nsamplebytes)

        Set audio parameters for generator.

        Parameters:
        rate - Sample rate in Hz.
        nchannels - Number of audio channels.
      • clearState

         final <Error class: unknown class> clearState()

        Clear match state. This will reset the queued matches and last per type.