Package com.iplateia.afplib
Class AfpMatcher
-
- All Implemented Interfaces:
public final class AfpMatcherAfpMatcher 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.
-
-
Constructor Summary
Constructors Constructor Description AfpMatcher(Service service, Handler handler)Creates an instance of AfpMatcher.
-
Method Summary
Modifier and Type Method Description final BooleangetRunning()final UnitsetAudioDB(AudioDB adb)Set AudioDB instance. final AudioDBgetAudioDB()Get current AudioDB instance. final <Error class: unknown class>loadAudioPack(String path)Load audio pack from filesystem. final <Error class: unknown class>loadAudioPack(BufferedInputStream bis)Load audio pack from BufferedInputStream. final BooleanstartCapture()Start audio capture mode. final <Error class: unknown class>stopCapture()Stop audio capture mode. final <Error class: unknown class>setAudioParams(Integer rate, Integer nchannels, Integer nsamplebytes)Set audio parameters for generator. final <Error class: unknown class>clearState()Clear match state. -
-
Method Detail
-
getRunning
final Boolean getRunning()
-
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.
-
loadAudioPack
final <Error class: unknown class> loadAudioPack(BufferedInputStream bis)
Load audio pack from BufferedInputStream.
- Parameters:
bis- The BufferedInputStream to load the audio pack from.
-
startCapture
final Boolean startCapture()
Start audio capture mode.
-
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.
-
-
-
-